Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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 and job9 all jobs implement a simple "echo hello world" command.
  • The solution contains four job streams with dependencies:
    • job_stream1 and job_stream2 represent two job chains that have to be executed successfully to make job_stream3 proceed.
    • job_stream3 splits the processing into parallel jobs (job8, job9).
    • job_stream4 is the final job chain that checks if job8 and job9 from job_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.
      • 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.
      • job4
        • implements the same check as job3.
      • 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.
      • 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. 
          • 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.
    • 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 as job6.
        • 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).
        • implements a ping command to the localhost that is executed once.
      • job9
        • makes use of the Named Post-Processing Monitor start_job_stream (by a <monitor.use> element) in the same way as job8.
        • 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 for job8 and job9.
    • 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 (job9job9): 
            • 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. 
        • will be skipped and the order moved to the next job node if the check fails.
  • 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's Start 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's Start 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 and job_stream2 completed successfully the job chain job_stream3 will be kicked off by job7 of job_stream2.
      • Job chain job_stream3 runs job8 and job9 in parallel.
      • job9 in job_stream3 will take longer than job8 to complete and will start job chain job_stream4.
      • Job chain job_stream4 with job10 will complete successfully.
  • Negative Check
    • Modify the job job1 in job chain job_stream1 to include an error, e.g. by adding the command exit 1 as the final line in the job script.
    • Start the order start_job_stream1 using JOC's Start Order now context menu. Alernatively add a new order.
      • The order should complete with an error having passed job1, no further jobs are executed.
    • Add a new order to job chain job_stream1 and specify job2 as the initial order state.
      • This approach simulates job2 being started independently.
      • The jobs job2 up to job6 in job chain job_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 and job_stream4 will be kicked off. The fact that job chain job_stream2 has previously completed successfully during the Positive Check run is sufficient to allow execution of job_stream3 and job_stream4..

...