Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Every change of files in the folder c:/temp which is matched by the filter ^file1\.xml$ starts a task for the job.

The SCHEDULER_TASK_TRIGGER_FILES environment variable contains the names of all the filtered files in the c:/temp folder at the time when the task was started - it doesn't just contain the name of the file that triggered the embedded script.
The file names are held in the form of a semicolon separated list.

Note that this behaviour could be critical when two files (e.g. file1.xml and file2.xml) are changed at the same time.
Two tasks will then be started for the job.
In the first task the environment variable SCHEDULER_TASK_TRIGGER_FILES will have the value c:/temp/file1.xml;c:/temp/file2.xml.
In the second task the environment variable SCHEDULER_TASK_TRIGGER_FILES will have a value that depends on what the first task has done with the files.
If, for example, the first task deletes the files in c:/temp then SCHEDULER_TASK_TRIGGER_FILES will be empty for the second task.

Set up as a standalone job in the JobScheduler editor JOE the script will look like:
Image Added

These settings are entered in the 'FileWatcher' tab in JOE as follows:
Image Added

For further information on how to use file events with a job chain we recommend to read the Directory Monitoring with File Orders.

...