Solved

Terminate Workbench on Condition

  • 16 October 2014
  • 7 replies
  • 53 views

Badge +2
Hi All,

 

 

I want to terminate the entire workbench translation, if any feature passes through it.

 

 

I have used the messagelogger and used "Error and Terminate" option but it is providing the message and continuing the other routed translation...

 

 

I have also used "Terminator” and changed the "Terminator Redirector" to Inspection but result is same.

 

 

Are there any transformers / other procedures or I have to change any settings to terminate the translation.

 

 

Kindly suggest...

 

 

Pratap
icon

Best answer by david_r 17 October 2014, 11:07

View original

7 replies

Userlevel 4
Hi,

 

 

the Terminator will stop the running translation. Could you please elaborate what you mean by "continuing the other routed translation"?

 

 

David
Userlevel 2
Badge +17
Hi,

 

 

David is right. Retry the Terminator after setting "No Redirect" (default) to the "Terminator Redirect" parameter.

 

 

Takashi
Badge +2
Hi David and Takashi,

 

 

Thanks for the reply.

 

 

I have used it but it is not solved. I have attached the screenshot to this query for reference as well as I have provided explanation as required.

 

 

My intention of stopping the workbench is to have control on writing the output in database.  If the condition has failed even for 1 feature remaining features are being written in database which I have to delete and re-translate the workbench. This is a very confused job since we are writing in different tables and we don’t have unique attribute to identify and delete in most of the times.

 

 

Explanation of “continuing the other routed translation”:

 

 

Input features will be supplied to each process ( I have 8 different translation process from single source) and respective translation will be done and connected to different outputs

 

 

 

 

Thank you.

 

 

Pratap
Userlevel 4
Hi,

 

 

There are couple of things going on here, and it's important to separate the flow of data in the workspace and the writing of features in your database. Terminating your workspace will not undo data that has already been written, as you've discovered. To the Terminator will not be your answer in this case. The issue is that your features are written in blocks (transactions), usually 1000 features at a time, so if an error occurs on feature 2067, that means that there are probably already 2000 features that have been committed to the database.

 

 

The best way of importing data is to stage it, meaning that you first writer your data into an import schema and then validate it. If the data is all clean, then you move it into production. I would not recommend doing all this from one workspace, so look into batch processing / WorkspaceRunner to automate the processing.

 

 

(A quick and dirty solution might be to increase the writer transaction size so that the transaction is larger than the number of features, but it's not something I'd recommend for production systems. For large datasets it might also slow things down drastically.)

 

 

Hope this helps.

 

 

David
Badge +2
Hi David,

 

 

Workbench wont write the features until all the features comes since I have feature holder transformer at the end (before writer). Untill all the features from different sources reaches they wont proceed to writer. 

 

 

So thatswhy I want to halt the translation in between if it is failed at certain checks.

 

 

Thanks

 

Pratap
Userlevel 4
Hi,

 

 

you will have to check your data flow. From you screenshot it seems that the output feature type did receive 2067 features before the Terminator was triggered.

 

 

Inspection points (http://docs.safe.com/fme/html/FME_Workbench/Default.htm#about_feature_inspection.htm) are your friend for debugging these things.

 

 

David
Badge +2
Hi David,

 

 

Thank you.

 

 

Pause the script will also do the needful.

 

 

Thank you.

 

 

Pratap

Reply