Forum Discussion

jervin's avatar
jervin
New Contributor III
5 years ago
Solved

Wait to run pipeline until target file does not exist

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 on...
  • jervin's avatar
    5 years ago

    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.