UNDER PROGRESS
Introduction
A job chains can be triggered by two type of Orders 1. time based Orders and 2. File Orders. A job chain can be configured to start on arrival of a file by using File Order Source. A File Order Source require configured by minimum to parameters 1. Directory
and 2. Regex
, where Directory is the file system location where JobScheduler should check for arrival of file and Regex
is the regular expression which should be matched with the filename. Most simple example of File Order Source is <file_order_source directory="c:\sandbox\outgoing" regex="^test.txt$"/>
Example: job chain FileWatching - file order source
In the following example FileWatching job chain is configured to start as soon as file test.txt
arrives in the directory c:\sandbox\outgoing.
<?xml version="1.0" encoding="ISO-8859-1"?> <job_chain title="File watching - file order source and regex" name="FileWatching"> <file_order_source directory="c:\sandbox\outgoing" regex="^test.txt$"/> <job_chain_node state="100" job="show_file_name" next_state="success" error_state="error"/> <file_order_sink state="success" remove="yes"/> <file_order_sink state="error" remove="yes"/> </job_chain>
Example: job - show_file_name
In the following example JobScheduler's inbuilt environment variable SCHEDULER_PARAM_SCHEDULER_FILE_PATH
will be used to print file name on the stdout.
<?xml version="1.0" encoding="ISO-8859-1"?> <job order="yes" stop_on_error="no" title="show file name" name="show_file_name"> <script language="shell"> <![CDATA[ @echo %SCHEDULER_JOB_NAME% : job starting @echo . @echo %SCHEDULER_JOB_NAME% :Start for file [ %SCHEDULER_PARAM_SCHEDULER_FILE_PATH% ]..... @echo . @echo File Name : %SCHEDULER_PARAM_SCHEDULER_FILE_PATH% @echo %SCHEDULER_JOB_NAME% :End for file [ %SCHEDULER_PARAM_SCHEDULER_FILE_PATH% ] ..... ]]> </script> <run_time /> </job>
Watching multiple directories
x
Watching multiple files
x