...
- Download the attached archive: file.zip
- Unzip the archive to the
live
folder of your JobScheduler installation - Adjust the configuration to your environment
Components
- A job chain that monitors the directory for incoming files
- Two jobs that process incoming files in sequence:
- Check the file for a string: if the string is available then the job chain is continued otherwise it is terminated.
- Start MS Access with the matching string found from the file
...
- JobScheduler provides parameters as environment variables to shell jobs. Two variables are used:
SCHEDULER_PARAM_SCHEDULER_FILE_PATH
: for a file order source JobScheduler provides this variable that contains the file pathSCHEDULER_RETURN_VALUES
: JobScheduler provides this variable that contains the name of a temporary file. Shell jobs could write pairs of names and values to the file that would become parameters for subsequent jobs.- The basic shell syntax is:
echo my_param=my_value>>%SCHEDULER_RETURN_VALUES%
- The PowerShell syntax is:
'my_param=my_value' | out-file -append $env:SCHEDULER_RETURN_VALUES
- The PowerShell syntax used in the job is:
'match=' + $match.Matches[0].Value | out-file -append $env:SCHEDULER_RETURN_VALUES
This syntax creates a parameter with the namematch
and the value from the matching string found in the incoming file.
- The basic shell syntax is:
- PowerShell is used in order to parse the incoming file for a regular expression. If a match is found then it is added as a parameter with the name
match
for subsequent jobs.- The search string is configured as
FF[0-9]*CA
which matches any strings in the file that start with the charactersFF
followed by a number of any length and terminate with the charactersCA
.
- The search string is configured as
- PowerShell returns an exit code 0 if a match has been found and exit code 1 otherwise.
- JobScheduler considers a job with exit code to be successful and would then continue with the next job node in the job chain and otherwise with the job node that is assigned to the error state.
Job: start_msaccess
The following job makes use of a previously found string match and would execute MS Access with a macro accordingly:
...