Check Directory for files after FTP operation

124 Views Asked by At

I currently have two custom business operation scripts that detect whether a file or files have been ftped. If the job was successful an email is sent.

I am looking to check if the directory is empty and if so send an email letting the user know that no files were found.

I am thinking that it would be done on the inbound service but can't quite figure out the code.

1

There are 1 best solutions below

0
Sylvain On

If you just want to send a notification (email) for an empty directory (through ftp), you can do it without any code from an inbound service by setting the Alerting Control parameters :

  • Alert on Error ( AlertOnError ) = true
  • Inactivity Timeout ( InactivityTimeout ) = number of seconds before raising the alert

NB: additionally, if not already existing, you'll need to add the Ens.Alert component, generally a simple business process router (ie: EnsLib.MsgRouter.RoutingEngine) which will receive the Alert Message and route it to the appropriate business operation in charge of sending the alert via email (ie: EnsLib.EMail.AlertOperation or a similar email operation).