This example configures a job chain which is made up of three other job chains.
- The check_day job is positioned at the start of the middle job chain and is used to test if the skip condition is met.
- If the condition is met then the order state for the middle job chain will be changed as required.
- In the example, the "main" job in the middle job chain is skipped on certain days.
- Unzip all files into the ./config/live folder of your JobScheduler installation.
- Open the JobScheduler Operating Center, JOC, in your browser using http://scheduler_host:scheduler_port
- Open the JOB CHAINS tab and enable "Show orders".
- Find the job chain
- Click on that chain. In the right window you will see that this job chain consists of 3 other chains: chain_a, chain_b and chain_c and that whilst all three job chains have a common job,
readparam, chain_b has an additional job,
- On the left side click on
- Find the order
my_orderand press "Start order now" in the Order menu.
The order will now move through the 3 job chains. If today is the 12th day of the month, only the first job (check_day) of the
chain_b will be executed and the rest of the job chain will be skipped.
samples/meta_chains_skip/chain_b and enable show_order_history on the right side and view the log of the order that just passed through the chain. If it's not the 12th day of the month you should see that the order has moved through both jobs
./config/live/samples/meta_chains_skip/check_day.job.xml, either with a code editor or with JOE - JobScheduler Object Editor
day_of_month == 12to check for the current day and save
Once JobScheduler has noticed the change in the configuration file, it will update the job definition. This may take up to one minute on non-Windows machines.
- Start the order again as described above
- Check the new log in the history of
samples/meta_chains_skip/chain_bto see that the order has skipped the rest of the chain.
How it works:
The change to the order state carried out by the set_state() causes JobScheduler to go to the end state of the current (in this case, the middle) job chain. The JobScheduler skips the jobs in between and ignores the return value of the job and the
error_state configuration of the job chain node.