Use this link to download the Process File Example files.
Unpack the zip file in the JobScheudler live folder, where you will find a job chain (ProcessFile) and an order (ProcessFile1) as well as a dummy job (changeme) that symbolises the file processing. You will also find two jobs in the "sos" sub-folder (JobChainStart and JobChainEnd) and two further jobs (DeleteFile and ExistsFile) in the "jitl" sub-folder.
The basic logic in this example is of a time event AND a file event.
The example order will start at 12:30. This can be changed as required and can be made cyclic if required.
The "trick" lies in the ExistsFile job, which checks whether a file is present. If the file is not present then this job will be restarted every minute up to a maximum of 30 times. If no file is found the order will then end in error. If a file is found, the job chain will continue to be processed.
This "polling" effect is realised using "setbacks". These are defined for the job and for the job chain as shown in the next two JOE screen shots:
From our point of view, this is the simplest solution.
As the ExistsFile job can also start job chains, this can be carried out in two steps - which is perhaps better for testing.
- First of all a job chain, which only consists of the ExistsFile job and then
- a second job chain, which is started by the ExistsFile job, as soon as a file (or all files) are found. An order can then be started for each file: these orders then being carried out in parallel if required.