Skip to main content
I'm relatively new to FME and love it so far but need a little guidance.  I'm developing workspaces using a custom reader that reads an object oriented file.  I never know what features I'm going to receive in the file and want to add some error handling in the begining of the process by testing to see if any features exist - if not, terminate.  I've tried adding a counter and a terminator to the reader but no features exist so I never get a number from the counter.   The workbench continues running since I have other readers (that do have features).   How do I terminate the workspace if a certain reader doesn't contain any features?  
You can use the transformer NoFeaturesTester and Terminator.

 

 

Tom
Tom - thanks for your help.  I tried out using the NoFeaturesTester and Terminator (which works great) but the rest of the workbench continues to run since I have other readers that do contain features.  How do I make the workbench terminate in the begining on a particular reader so it doesn't run the rest of the translation?  Does that make sense?
Hi Jon,

 

 

I suppose that you applied NoFeaturesTester + Terminator to every reader feature type in the workspace.

 

However, since the Workbench reads the source datasets in the order of the tree nodes shown on the Navigator window, the process starting from the upper dataset will be continued even if there are no features in the lower dataset.

 

I guess you encountered such a situation.

 

 

You can modify the order of the tree nodes (datasets) by drag-and-drop or right-click a node. But I don't think it's possible to stop the process starting from the upper dataset before the lower dataset causes terminating.

 

 

Takashi

 


Use your custom reader for the object oriented file dataset and then use the FeatureReader transformer for the subsequent datasets. The FeatureReader requires an input feature to tell it to do something, so it will only read features if your initial reader had data.
The FeatureReader read the data for every INITIATOR, so the data is duplicated.

 

 

Another way:

 

 

A small Workbench that checks empty Input und call the full Workbench (WorkspaceRunner).
Hi,

 

you can use the Directory and File Pathnames format  off reader and specify the path filter (example : *.shp). 

 

if file with this extension exists into a directory the traitment launches. If there is no file, no traitment starts.

 

 

Farfar
I ended up using a NoFeaturesTester and FeatureReader.  The inititator for the FeatureReader came from the Input from the NoFeaturesTester.  The NoInput port calls a terminator.

 

 

Thanks for everyones help!

Reply