cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Wait to run pipeline until target file does not exist

jervin
New Contributor III

I need a pipeline to wait until a file (named say test.csv) on a network share is picked up and moved/deleted by another process. Then my pipeline can write a new test.csv. The other process might only take a few seconds, or could take up to an hour to process test.csv. Is there a way to have my SnapLogic pipeline watch test.csv on the network share and wait until that file is gone and then continue processing? This would be sort of the opposite of what File Poller does.

1 ACCEPTED SOLUTION

jervin
New Contributor III

Figured it out. If anyone else is trying to accomplish the same task, here is my solution:

  1. File Poller monitors the source location (โ€œoutโ€ folder). โ€œOnly Output on Changeโ€ is not enabled.
  2. When input is received from File Poller, Directory Browser reads the target folder filtered for test.csv.
  3. Filter snap checks to see if the Name path in the JSON object exists using this expression: !($.hasPath(โ€œNameโ€)). If the path does not exist, filter the record so no further processing is done.
  4. If the Name path exists, proceed to the File Reader snap and read the file from the out folder.
  5. Write the file to the target location.
  6. Delete the file from the out folder.

2021-04-21 11_17_10-SnapLogic Designer - 5ee732cd86a4296d121b2640_072863b5-ffab-4744-8223-c75d603c54

View solution in original post

1 REPLY 1

jervin
New Contributor III

Figured it out. If anyone else is trying to accomplish the same task, here is my solution:

  1. File Poller monitors the source location (โ€œoutโ€ folder). โ€œOnly Output on Changeโ€ is not enabled.
  2. When input is received from File Poller, Directory Browser reads the target folder filtered for test.csv.
  3. Filter snap checks to see if the Name path in the JSON object exists using this expression: !($.hasPath(โ€œNameโ€)). If the path does not exist, filter the record so no further processing is done.
  4. If the Name path exists, proceed to the File Reader snap and read the file from the out folder.
  5. Write the file to the target location.
  6. Delete the file from the out folder.

2021-04-21 11_17_10-SnapLogic Designer - 5ee732cd86a4296d121b2640_072863b5-ffab-4744-8223-c75d603c54