...
- The solution contains six job chains:
JobChain1
runsJob1
andJob2
in parallel.- On successful completion of
Job1
thenJobChain2
is run - On successful completion of
Job2
thenJobChain3
is run
- On successful completion of
JobChain2
runsJob3
andJob4
JobChain3
runsJob5
andJob6
JobChain4
runs after successful completion ofJobChain1
JobChain4
runsJob7
,Job8
,Job9
Job7
runs 1stJob8
runs onceJob7
andJob4
have run successfully
JobChain5
runs after successful completion ofJobChain1
JobChain5
runsJob10
,Job11
andJob12
Job10
runs 1stJob11
runs onceJob10
,Job4
andJob6
have run successfullyJob12
runs onceJob11
has completed successfully
JobChain6
runs onceJob9
andJob12
have completed successfully
Usage
- The first job
split1
set some pairs of parameters in a pre-processing to control the dependencieswhich job tells that it is successfully completed.- The first parameter of the pair is a flag which is used to for a later check if the dependent jobs are successfully completed.
- The value of this parameter is initialised with "0" and will be modified by the dependent jobs with "1".
In above example these are
Code Block job4_successfully_completed=0
- which will
- be
- checked
- by
Job8
- and
Job11
job6_successfully_completed=0
- which will
- be
- checked
- by
Job11
job12_successfully_completed=0
- which will
- be
- checked
- by
-
Job13
- The second parameter of the pair describes which job commits which job chains that it has successfully completed.
- You need to specify all job chains, in which the order can be located with respect to the checking jobs
- The current job chain (here
JobChain1
) is always the first in the list. - The job chains can specify with its absolute path or relative to the current job chain (here Job Chain 1).
In above example these are
Code Block job4_commits_
completion_to="/
parallelExecutionExample/
JobChain1;
JobChain4;
JobChain5"
- The first parameter of the pair is a flag which is used to for a later check if the dependent jobs are successfully completed.
- 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_Z
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
job6_commits_completion_to="/parallelExecutionExample/JobChain1;JobChain5"
job12_commits_completion_to="/parallelExecutionExample/JobChain1;JobChain4;JobChain6"
- The dependent jobs (here
Job4
,
andJob6
) have a post-processing where they resume the ordersJob12
- in all job chains which are specified in the "
commits_completion_to
" parameter - where the value of the "
successfully_completed
" parameter is set to "1"
- in all job chains which are specified in the "
- The jobs which wait of its dependent jobs have a pre-processing where they check the corresponding "
successfully_completed
" parameters- These jobs have a task parameter "
dependent_jobs
" where a list of its dependent jobs are specified. - In above example these are
Job8 : dependent_jobs="Job4"
Job11: dependent_jobs="Job4;Job6"
Job13: dependent_jobs="Job12"
- These jobs have a task parameter "
The above described pre- and post-processings include the attached
control_parallel_execution_of_job_chains.js
file so that you have following small configurationCode Block title pre-processing of split1 collapse true <monitor name="set_params_for_check_jobs" ordering="1"> <script language="javax.script:ecmascript"> <include live_file="control_parallel_execution_of_job_chains.js"/> <![CDATA[ function spooler_process_before(){ //Specify the list of job chains for which Job4 commits that it has run successfully //These job chains can specify relative to the current job chain setParams4CheckingJobs( "Job4", ["Chain4", "Chain5"] ); //Specify the list of job chains for which Job6 commits that it has run successfully //These job chains can specify relative to the current job chain setParams4CheckingJobs( "Job6", ["Chain5"] ); //Specify the list of job chains for which Job12 commits that it has run successfully //These job chains can specify relative to the current job chain setParams4CheckingJobs( "Job12", ["Chain4", "Chain6"] ); spooler_log.info(spooler_task.order().params().xml()); return true; } ]]> </script> </monitor>
Code Block title post-processing of Job4, Job6 and Job12 collapse true <monitor name="commit_successfully_run" ordering="0"> <script language="javax.script:ecmascript"> <include live_file="control_parallel_execution_of_job_chains.js"/> <![CDATA[ function spooler_process_after(spooler_process_result){ return commit_successful_run(spooler_process_result); } ]]> </script> </monitor>
Negative CheckCode Block title pre-processing of Job8, Job11 and Job13 collapse true <monitor name="check_dependent_jobs" ordering="0"> <script language="javax.script:ecmascript"> <include live_file="control_parallel_execution_of_job_chains.js"/> <![CDATA[ function spooler_process_before(){ return check_dependent_jobs(); } ]]> </script> </monitor>
- 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 to job_chain_A
that then runs successfully should result in a successful run of job_chain_Z
- either by a new order added to job_chain_Z
or by the next execution of the previous order that has been set back.See also
- How to check the job chain history for previous job chain and order runs
- How to add a condition to check previous jobs before the execution of the current job chain
...