Scope
- Use Case
Create Job Stream #1
- 1. Batch Job #1 runs without pre-condition.
2. Batch Job #2, #3, #4, #5, #6 will run if the respective predecessor Batch Job completed successfully.
Create Job Stream #2:
3. Batch Job #7 runs without pre-condition.
Combine the 2 Job Streams into a new Job Stream #3:
4. Batch Job #8 and Batch Job #9 (in Job Stream #3) will be automatically started and running at the same time IF AND ONLY IF Job Stream #1 and Job Stream #2 ran successfully.
Create Job Stream # 4:
5. Batch Job #10 (in Job Stream #4) runs only after the successful completion of Job #8 and #9 in Job Stream #3.
- Feature Availability
-
FEATURE AVAILABILITY STARTING FROM RELEASE 1.10.2
-
JITL-228
-
Getting issue details...
STATUS
-
FEATURE AVAILABILITY STARTING FROM RELEASE 1.10.2
Solution
- Download: workflow_condition_job_chains.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
workflow_condition_job_chains. - Note that you can store the sample files in any folder you like.
Pattern

Implementation
Components
- Hints
- The solution makes use of Scripting with Pre-/Post-Processing Monitors.
- The term completed successfully as subsequently used includes that
- if not specified otherwise the last run of a job chain assigned an order an end state that is not used as an error state in the job chain..
- the last run of a job chain was successful (not any previous runs within the same period).
- The conditions assigned to job chains are handled in a way that the successor job chain is executed if the conditoins can be met.
- Except for
job8andjob9all jobs implement a simple "echo hello world" command.
- The solution contains four job streams with dependencies:
job_stream1andjob_stream2represent two job chains that have to be executed successfully to makejob_stream3proceed.job_stream3splits the processing into parallel jobs (job8,job9).job_stream4is the final job chain that checks ifjob_stream3did complete successfully.
- The solution implements the following job dependencies:
job_stream1job1- runs without dependencies.
job2, job3, job4, job5, job6- run if their predecessor job completed successfully
job6- makes use of the Named Post-Processing Monitor
start_job_stream(by a<monitor.use>element):- the Post-Processing Monitor will not start job chains if the job completes with a return code > 0 signalling an error or if one of the checks fails.
- this Monitor checks if a number of jobs completed successfully (
job_stream2):- the job chain names are specified by use of the
check_job_chainsjob parameter that is assigned a semicolon separated list of job chain names. - job chain names can be specified with an absolute path (starting from the
livefolder) or with a path relative to the directory of this job.
- the job chain names are specified by use of the
- if the checks are successful then this Monitor will start a number of job chains (
job_stream3):- the job chain names are specified by use of the
start_job_chainsjob parameter that is assigned a semicolon separated list of job chain names. - job chain names can be specified with an absolute path (starting from the
livefolder) or with a path relative to the directory of this job.
- the job chain names are specified by use of the
- makes use of the Named Post-Processing Monitor
job_stream2job7- makes use of the Named Post-Processing Monitor
start_job_stream(by a<monitor.use>element) in the same way asjob6. - the same job parameterization applies as for
job6with the exeception that the check is performed forjob_stream1.
- makes use of the Named Post-Processing Monitor
job_stream3splitter- makes use of the Named Post-Processing Monitor
start_job_stream(by a<monitor.use>element) in the same way asjob6. - the same job parameterization applies as for
job6with the exeception that the check is performed forjob_stream1andjob_stream2. - splits processing of the current order into parallel execution of jobs
job8andjob9.
- makes use of the Named Post-Processing Monitor
job8, job9- run without dependencies.
- run in parallel.
- sync
- waits for
job8andjob9to complete successfully.
- waits for
dispatcher- makes use of the Named Post-Processing Monitor
start_job_stream(by a<monitor.use>element) in the same way asjob6. - the same job parameterization applies as for
job6with the exception that no check is performed but
- makes use of the Named Post-Processing Monitor
job_stream4- job10
- makes use of the Named Pre-Processing Monitor
check_job_chain_historyby a<monotor.use>element) in- this Monitor checks if a number of job chains completed successfully (
job_stream3):- the job chain names are specified by use of the
check_job_chainsjob parameter that is assigned a semicolon separated list of job chain names. - job chain names can be specified with an absolute path (starting from the
livefolder) or with a path relative to the directory of this job.
- the job chain names are specified by use of the
- this Monitor checks if a number of job chains completed successfully (
- will be skipped and fail if the check fails.
- makes use of the Named Pre-Processing Monitor
- job10
Usage
- Positive Check
- Start the order
start_job_stream1using JOC'sStart Order nowcontext menu. Alernatively add a new order.- The order should pass through the job chain without errors.
- Start the order
start_job_stream2using JOC'sStart Order nowcontext menu. Alternatively add a new order.- The order should also pass through the job chain without errors.
- As the job chains
job_stream1andjob_stream2completed successfully the job chainjob_stream3will be kicked off byjob7ofjob_stream2. - Job chain
job_stream3runsjob8andjob9in parallel. job9injob_stream3will take longer thanjob8to complete and will start job chainjob_stream4.- Job chain
job_stream4withjob10will complete successfully.
- Start the order
- Negative Check
- Modify the job
job1in job chainjob_stream1to include an error, e.g. by adding the commandexit 1as the final line in the job script. - Start the order
start_job_stream1using JOC'sStart Order nowcontext menu. Alernatively add a new order.- The order should complete with an error having passed
job1, no further jobs are executed.
- The order should complete with an error having passed
- Start the order
start_job_stream2using JOC'sStart Order nowcontext menu. Alernatively add a new order.job7will be executed succesfully, however,job_stream3will not be started due to the fact thatjob_stream1completed with error.
- Modify the job
References
Change Management References
Documentation
- How to check the job chain history for previous job chain and order runs
- How to manage complex conditions to check previous job executions and to start successor job chains
- How to check the job history for previous job runs