Skip to main content
Hi Everyone,

 

 

I have a workspace which contains a reader for a WFS and a writer for Oracle. I have an issue where if the WFS doesn't read any data then it does NOT run any of the transformers or the pre/post sql scripts for the writer.

 

 

This is a problem because if the data has changed we want out database to reflect that. This means that if there is NO data in the WFS we want our table to have no data in it. I can write python to have it delete the data from Oracle but then I also have to kick off some procedures and run some other SQL and realistically that should be in the post SQL. Additionally this would add a third party dependency on a python module which we don't want.

 

 

My questions - Is this a bug or is this how it is meant to function? Is there possibly a setting I'm meant to change for WFS to run the workspace even when no features are read?
Hi,

 

 

this is (unfortunately) how FME works, and it has been discussed quite a bit on this (and other forums) already. FME is inherently feature-based and not dataset-based, which leads to difficulties when replicating empty datasets (i.e. no features and therefore no processing).

 

 

I suggest you write Safe support (https://safecommunity.force.com/knowledgeSubmitCase) and add your name to the list of those wishing for an enhancement in this area.

 

 

David
Hi Matty

 

David is quite right in that we sometimes struggle to support workflows where no is read.  We will follow-up on that issue in support where I see you have filed a case.

 

 

But I think there is a way you can deal with this particular requirment.  On the FME Store we have a custom transformer called the NoFeaturesTester (just type the name in canvas to download it).  If you connect your WFS source to this and it happens to read nothing then a single feature will come out of the NOINPUT port. You could connect that feature to a SQLExecutor transformer and use a truncate table statement there or whatever you need to do in the event of no data being read. Does that help?

 

 

 


Reply