...
- Hints
- The solution makes use of Scripting with Pre-/Post-Processing Monitors and date calculation.
- The term completed successfully as subsequently used includes that
- if not specified otherwise the last run of a job took place within the current period that is the current day (24pm to 0am).
- the last run of a job was successful (not any previous runs within the same period).
- The conditions assigned to jobs are handled in a way that job execution is skipped and processing is continued with the next job. The default behavior of JobScheduler would be to stop processing and wait for a condition to be met.
- Except for
job8
andjob9
all jobs implement a simple "echo hello world
" command.
- The solution contains four job streams with dependencies:
job_stream1
andjob_stream2
represent two job chains that have to be executed successfully to makejob_stream3
proceed.job_stream3
splits the processing into parallel jobs (job8
,job9
).job_stream4
is the final job chain that checks ifjob8
andjob9
fromjob_stream3
did complete successfully.
- The solution implements the following job dependencies:
job_stream1
job1
- runs without dependencies.
- is configured for setback, i.e. will repeat iself in case of error up to two times.
job2
- implements an individual Pre-Processing Monitor to check if the current day is Wednesday and if the predecessor job
job1
completed successfully before 11:00pm. - will be skipped and the order moved to the next job node if the check fails.
- implements an individual Pre-Processing Monitor to check if the current day is Wednesday and if the predecessor job
job3
- implements an individual Pre-Processing Monitor to check if the current date is before the 10th of month and if the predecessor job
job2
completed successfully before 11.30pm. - will be skipped and the order moved to the next job node if the check fails.
- implements an individual Pre-Processing Monitor to check if the current date is before the 10th of month and if the predecessor job
job4
- implements the same check as
job3
.
- implements the same check as
job5
- implements an individual Pre-Processing Monitor to check if two predecessor jobs (
job3
,job4
) completed successfully and consumed less than 45 min. execution time. - will be skipped and the order moved to the next job node if the check fails.
- implements an individual Pre-Processing Monitor to check if two predecessor jobs (
job6
- implements an individual Pre-Processing Monitor to check if the current day is a Thursday or Friday and if the date is after the 5th and before the 15th of month.
- will be skipped and the order moved to the
success
end node if the check fails. - 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 (
job6
,job7
):- the job names are specified by use of the
check_jobs
job parameter that is assigned a semicolon separated list of job names. - job names can be specified with an absolute path (starting from the
live
folder) or with a path relative to the directory of this job. - the current job is exempted from checks as it is running, i.e. not completed, and resulted in a successful return code 0.
- the job 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_chains
job 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
live
folder) or with a path relative to the directory of this job.
- the job chain names are specified by use of the
job_stream2
job7
- implements an individual Pre-Processing Monitor to check if the current day is within the first week of a month.
- will be skipped and the order moved to the
success
end node if the check fails. - 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
job6.
job_stream3
job8
- makes use of the Named Post-Processing Monitor
start_job_stream
(by a<monitor.use>
element):- the Monitor checks if a number of jobs completed successfully (
job8
,job9
). - if the checks are successful then this Monitor will start a number of job chains (
job_stream4
).
- the Monitor checks if a number of jobs completed successfully (
- implements a
ping
command to the localhost that is executed once.
- makes use of the Named Post-Processing Monitor
job9
- makes use of the Named Post-Processing Monitor
start_job_stream
(by a<monitor.use>
element) in the same way asjob8
. - the same job parameterization applies as for
job8.
- implements a
ping
command to the localhost that is executed ten times. This is intended to have different execution times forjob8
andjob9
.
- makes use of the Named Post-Processing Monitor
job_stream4
- job10
- makes use of the Named Pre-Processing Monitor
check_job_history
by a<monotor.use>
element) in- this Monitor checks if a number of jobs completed successfully (
job9
,job9
):- the job names are specified by use of the
check_jobs
job parameter that is assigned a semicolon separated list of job names. - job names can be specified with an absolute path (starting from the
live
folder) or with a path relative to the directory of this job. - the current job is exempted from checks as it is running during the check, i.e. not completed, and resulted in a successful return code 0.
- the job names are specified by use of the
- this Monitor checks if a number of jobs completed successfully (
- will be skipped and the order moved to the next job node if the check fails.
- makes use of the Named Pre-Processing Monitor
- job10
- The Monitors include a number of date checks that are disabled (to make the examples operable by default) by use of comments such as
/* =>
isJobRunEnabled = ( Date.today().getDate() < 10 );
*/
- Please remove comments to enable the respective checks.
...
- Positive Check
- Start the order
start_job_stream1
using JOC'sStart Order now
context menu. Alernatively add a new order.- The order should pass through the job chain without errors.
- Start the order
start_job_stream2
using JOC'sStart Order now
context menu. Alternatively add a new order.- The order should also pass through the job chain without errors.
- As the job chains
job_stream1
andjob_stream2
completed successfully the job chainjob_stream3
will be kicked off byjob7
ofjob_stream2
. - Job chain
job_stream3
runsjob8
andjob9
in parallel. job9
injob_stream3
will take longer thanjob8
to complete and will start job chainjob_stream4
.- Job chain
job_stream4
withjob10
will complete successfully.
- Start the order
- Negative Check
- Modify the job
job1
in job chainjob_stream1
to include an error, e.g. by adding the commandexit 1
as the final line in the job script. - Start the order
start_job_stream1
using JOC'sStart Order now
context 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
- Add a new order to job chain
job_stream1
and specifyjob2
as the initial order state.- This approach simulates
job2
being started independently. - The jobs
job2
up tojob6
in job chainjob_stream1
are skipped due to failed or missing execution of predecessor jobs. - Should you previously have performed the Positive Check then the job chains
job_stream3
andjob_stream4
will be kicked off. The fact that job chainjob_stream2
has previously completed successfully during the Positive Check run is sufficient to allow execution ofjob_stream3
andjob_stream4
..
- This approach simulates
- Modify the job
...