Solved

Capture and log error using Workspace (SystemCaller) + SFTP using Automation


Badge +10

Hello

 

Just need some guidance:

 

 

I'm currently using SystemCaller + AttributeFilter (0 & 1 for error logging) as a workspace to run a batch file daily which does the following:

- Delete existing log files

- Create WinScp log file

- After setting some variables then log in to SFTP server using WinSCP commands

- Upload a file, check its existence on remote server and if exist then upload the respective ".Done" empty file from local server. Exit with Code 0. If failure then abort and always exit with Code 1.

- Catch error in case of failure and output it to error.txt (it will tell me which file failed)

- Script repeats the same process for the remaining 4 datasets.

E-mailer attached to attribute filter 1

That's working.

 

I want to:

Option 1

Use automation to achieve the same result albeit SFTP "External Action" fails to validate the connection and states "Invalid - Path not found". For now I've given up on trying to understand so will skip that option.

Option 2

SystemCaller + AttributeFilter saved as a workspace called Script (We'll call it that)

I upload Script then link it to an external action (Email) if failure.

 

How would the workspace be setup to achieve this because if workspace return code 1, from FME's perspective the translation was successful.

 

Thanks

Sameer

icon

Best answer by virtualcitymatt 9 June 2020, 13:01

View original

5 replies

Userlevel 4
Badge +26

FME has a Terminator transformer you can use to force FME to fail. Does that help? I'm not sure that I fully understand what you're trying to do, however, the Terminator can be very helpful

Badge +10

FME has a Terminator transformer you can use to force FME to fail. Does that help? I'm not sure that I fully understand what you're trying to do, however, the Terminator can be very helpful

Never used that one before but will try. Thanks for your prompt response.

Basically the final stage of my process is to upload different datasets related to vulnerable people to an SFTP site. If the files have successfully been uploaded then their respective .Done files must also be uploaded too.

All I wanted was to use FME Server Automation to achieve the same process without having to rely on my batch script. Hope this is clearer.

Userlevel 4
Badge +26

Never used that one before but will try. Thanks for your prompt response.

Basically the final stage of my process is to upload different datasets related to vulnerable people to an SFTP site. If the files have successfully been uploaded then their respective .Done files must also be uploaded too.

All I wanted was to use FME Server Automation to achieve the same process without having to rely on my batch script. Hope this is clearer.

Ahh FME Server - yes nice. Yeah the Terminator will be your friend for handling and forcing errors in unhanded exceptions. Really helpful in validation workflows as you can also return the ERROR message. This error message can also be consumed by most FME Server subscriptions like the email. It lets you really tailor your error messages

Badge +10

FME has a Terminator transformer you can use to force FME to fail. Does that help? I'm not sure that I fully understand what you're trying to do, however, the Terminator can be very helpful

Terminator transformer works. Nice and simple and never used it before.

Sometimes we tend to over complicate things when we're stuck in dealing with complex issues.

Userlevel 4
Badge +26

Terminator transformer works. Nice and simple and never used it before.

Sometimes we tend to over complicate things when we're stuck in dealing with complex issues.

Yep - I feel you @sameer - glad to be able to help

Reply