Solved

Move files to error directory after failed FeatureWriter

  • 6 September 2022
  • 4 replies
  • 0 views

Badge

Is it possible to move files to an error directory when a FeatureWriter fails? Unfortunately, I have not found a way so far. Is there any other way than to use an FMEServer Automation that triggers another FME Workbench in case of an error, which only moves files to a directory? Is it possible to achieve this with only one FME Workbench?

icon

Best answer by virtualcitymatt 6 September 2022, 10:15

View original

4 replies

Userlevel 4
Badge +26

Hmm, What kind of files would you be moving? input files or some kind of half written output?

 

Assuming a FeatureWriter fails you can use a Filecopy writer to move (or copy) files to a new directory. You'd need to attach the workflow to all your FeatureWriter rejection ports though (this also assumes a feature will come out of here).

 

Another option could be to create a python shutdown script - this could achieve what you want as well and might make it look cleaner?

 

https://community.safe.com/s/article/shutdown-python-scripts-in-fme#:~:text=In%20the%20Navigator%20pane%2C%20go,workspace%20with%20your%20own%20data.

Badge

Hi virtuakcitymatt,

it is a csv import file with data that I want to write to my SQL database. However, if the FeatureWriter fails for some reason, I want the files that could not be imported to be moved to an error directory.

 

But when FeatureWriter fails, the entire translation stops, so I haven't figured out how to take a final action (move the files to an error directory) after the failure.

 

Thank you for your advice to use a python shutdown script. I will try this and see if it works.

 

 

Userlevel 4
Badge +26

Hi virtuakcitymatt,

it is a csv import file with data that I want to write to my SQL database. However, if the FeatureWriter fails for some reason, I want the files that could not be imported to be moved to an error directory.

 

But when FeatureWriter fails, the entire translation stops, so I haven't figured out how to take a final action (move the files to an error directory) after the failure.

 

Thank you for your advice to use a python shutdown script. I will try this and see if it works.

 

 

Ahh right, check your workspace parameters on how rejected features are handled. It could be as simple as switching from ending the process to continuing the process​.

Badge

Ahh right, check your workspace parameters on how rejected features are handled. It could be as simple as switching from ending the process to continuing the process​.

Thank you for your inputs!

Reply