...
Solution
- Download: final_chain_job_chain_history.zip
- Extract the archive to a folder in your JobScheduler installation named
./config/live/issues
. - The archive will extract the files to a sub-folder
final_chain_job_chain_history.
- Note that you can store the sample files in any folder you like: however, you will then have to adjust the job parameters accordingly.
Pattern
Flowchart |
---|
order_A [shape="ellipse",label="Order A\n start time: Friday 08:00 ",fillcolor="violet"] order_B [shape="ellipse",label="Order B\n start time: Friday 07:00 ",fillcolor="violet"] order_Z [shape="ellipse",label="Order Z\n start time: Friday 15:00 ",fillcolor="violet"] job_chain_A [label="Job Chain A\nhas no relevant dependencies",fillcolor="orange"] job_chain_B [label="Job Chain B\nhas no relevant dependencies",fillcolor="orange"] job_chain_Z [label="Job Chain Z\ndepends on the execution of\nJob Chain A and Job Chain B",fillcolor="orange"] job_check_predecessor [label="Job check_predecessor",fillcolor="lightskyblue"] job_next_job [label="Next Job", fillcolor="lightskyblue"] check_predecessor_successful [shape=diamond,label="execution successful\nfor Job Chain A and Job Chain B?",fillcolor="white"] order_setback [label="Set back Order",fillcolor="white"] order_A -> job_chain_A order_B -> job_chain_B order_Z -> job_chain_Z job_chain_Z -> job_check_predecessor job_check_predecessor -> job_chain_A job_check_predecessor -> job_chain_B job_check_predecessor -> check_predecessor_successful check_predecessor_successful -> job_next_job [label=" yes "] check_predecessor_successful -> order_setback [label=" no "] order_setback -> job_check_predecessor |
...
- The solution contains three job chains:
job_chain_A
andjob_chain_B
represent the predecessor job chains that have no relevant dependencies withjob_chain_Z
.job_chain_Z
is the final job chain that checks ifjob_chain_A
andjob_chain_B
have already been executed successfully.
- The solution implements a job
check_predecessor_job_chain_Z
that has been added at the start ofjob_chain_Z
.- This job is parameterized with a number of parameters that start with the prefix "check_predecessor" and use an arbitrary suffix that is required in order to create unique parameter names. The value of each parameter is the final job of the respective job chain that is checked for successful execution:makes use of a parameter
check_job_chains
that is assigned a semicolon separated list of job chain names.- Job chain names can be specified with an absolute path (starting from the
live
folder) or with a path relative to the directory of this job. - Example:
check_predecessorjob_A = issues/final_chain/do_something_chains = job_chain_A
check_predecessor_B = issues/final_chain/do_something_;job_chain_B
- Should the sample files not have been extracted to the
./config/live/issues/final_chain
folder then please adjust the parameter value to point to the relevant directory.
- Job chain names can be specified with an absolute path (starting from the
- This job implements a
spooler_process()
function that reads the parameters and checks the job cahin history for successful execution of the jobs job chains specified by the parametersparameter. - Should all checks for previous successful execution provide a positive result then the current order will be moved to the next job chain node. Otherwise the current order is set back and will be repeated regularly according to the setback configuration for this job.
- This job is parameterized with a number of parameters that start with the prefix "check_predecessor" and use an arbitrary suffix that is required in order to create unique parameter names. The value of each parameter is the final job of the respective job chain that is checked for successful execution:makes use of a parameter
...
- Positive Check
- Add an order to
job_chain_A
using JOC'sAdd Order
context menu.- The order should pass through the job chain without errors.
- Add an order to
job_chain_B
using JOC'sAdd Order
context menu.- The order should also pass through the job chain without errors.
- Add an order to
job_chain_BZ
using JOC'sAdd Order
context menu.- The order should pass through the job chain without errors as all pre-conditions are met.
- Add an order to
- Negative Check
- Modify the job
do_something_job_chain_A
to include an error, e.g. by adding the commandexit 1
as the final line in the job script. - Add an order to
job_chain_A
:- The order should proceed with an error.
- Add an order to
job_chain_Z
- The order should proceed with an error that is visible in the order log. This error will state that the predecessor job did not complete successfully.
- The order will be set back and will be repeated according to the setback intervals that have been specified for the job
check_predecessor_job_chain_Z
.
- Removing the modification to job
do_something_job_chain_A
and adding an order tojob_chain_A
that then runs successfully should result in a successful run ofjob_chain_Z
- either by a new order added tojob_chain_Z
or by the next execution of the previous order that has been set back.
- Modify the job
...