Versions Compared

Key

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

Table of Contents

Scope

  • JobScheduler implements the concept of a "critical path", i.e. the fact that in case of time constraints some less critical jobs should be skipped during daily or nightly processing.
  • This article introduces the solution for JobScheduler.

Download & Installation

  • Display feature availability
    StartingFromRelease1.9

    • Starting with this release this feature is included with the JobScheduler setup.
    • For previous releases please use the below downloads.
  • Download the unpack the attached filearchive: 
  • Unzip the archive to your
  • Installation
  • ./
      • Java JAR files
        • user_lib/com.sos-berlin.jitl.criticalpath-0.1.jar
          • copy this file to the <scheduler_home>/lib/user_lib folder. If this folder not exists, copy the file to the <scheduler_home>/lib folder directly.
      • Job Documentation
        • jobs/JobSchedulerCriticalPathUncriticalJobNodes.xml
          • copy this file to <scheduler_install>/jobs
      • Job Object Folder
            • config/live/sos
        folder. All files contained will be unzipped to an operations sub-folder.

      Explanations

            • /operations/criticalpath
              • copy this folder to <scheduler_install>/config/live/sos/operations/criticalpath

      Explanations

      Job Chain sos/operations/criticalpath/UncriticalJobNodes

      The functionality includes job nodes to be skipped for critical path processing. This is achieved by

      • marking a job node being part of a critical path by prefixing the job node state attribute either with "+" (required) or "-" (skippable).
      • running a new JITL job "activate_critical_path" the Skip order  that depending on its parameterization would run in one of these processing modes:
        • skip the job nodes that are marked as being skippable ("-") (default) or
        • skip the job nodes that are not marked as being required ("+").
        running a new JITL job "deactivate_critical_path" that would
      • running the Unskip order that will reverse the above operation.

      ...

      • Job node states in job chains can be marked to be skipped for critical path processing by prefixing them with a "-" character.
      • Job node states in job chains can be marked to be required for critical path processing by prefixing them with a "+" character.

      Usage 

      ...

      A business process is comprises usually consists of 1 one or more individual steps (jobs). A job may or many not need a precondition to start i.e. previous job must be successfully completed or its outcome doesn't affect the rest of the jobs in the job chain. such jobs are called optional or non critical jobs. Few common examples of such jobs are delete temporary files, create DB index or generate a XSL report. The  The critical path is series of steps(job) in a business process( job chain), which should be completed to achieve business process's goals i.e. complete transaction loading, generate Bills etc. jobs that make up a job chain. In some cases not all jobs are important to the same extent. Should you face a situation when there is not enough time to process all the jobs of a job chain, e.g. after a maintenance window that reduces nightly processing by some hours, then the critical path defines the sequence of jobs are required to be executed and exlcudes jobs of minor importance to save processing time.

      Planned Critical Path Activation 

      Scenario 

      More Quite often then not business process has a fix business processes do not provide of a fixed start time, average run time and a expected end time, but in case of circumstances  where fix the fixed start time has to be changed i, e.eg. System due to system maintenance, later then usual delayed availability of input data etc.

      • In such a an exceptional situation to achieve the business process goals with adherence to the SLA, some jobs can be excluded from the business process (job chains).
      • A non critical job can be marked in a job chain either being skippable ("-" skippable ) or being critical ("+" critical job during job chain development ) for the business process.
      • If a situation arises where part parts of the job chain has have to be skipped, then the JobScheduler admin can start the  job activate_critical_path.job.xml. Job activate_critical_path.job.xml  will operator can start the Skip orderThis order will search through the JobScheduler configuration and set the non-critical job(s) as skipjobs to skip processing of orders.
      • A job chain with non-critical job(s) jobs is set to skip by all the Ordersprocessing of orders by these jobs independently from the start event of these orders (manually/scheduled).
      • Once the business process completes with only with  critical jobcritical jobs, then the job chains chain's original state can be reset reactivated by the job deactivate_critical_path.job.xml Unskip order.

      Example Job Chain

      Code Block
      languagexml
      titleJob chain critical path
      collapsetrue
      <?xml version="1.0" encoding="iso-8859-1"?>
      <job_chain  orders_recoverable="yes" visible="yes" title="JobChainA" max_orders="3">
          <job_chain_node  state="Start"   job="/sos/jitl/JobChainStart" next_state="-100"    error_state="End_Err"/>
          <!-- non critical job step , when critical path is active following job will be skipped -->
          <job_chain_node  state="-100"    job="01_TaskA1"               next_state="200"     error_state="End_Err"/>
          <job_chain_node  state="200"     job="01_TaskA2"               next_state="-300"    error_state="End_Err"/>
          <!-- non critical job step , when critical path is active following job will be skipped -->
          <job_chain_node  state="-300"    job="01_TaskA3"               next_state="400"     error_state="End_Err"/>
          <job_chain_node  state="400"     job="01_TaskA4"               next_state="500"     error_state="End_Err"/>
          <job_chain_node  state="500"     job="01_TaskA5"               next_state="End_Suc" error_state="End_Err"/>
          <job_chain_node  state="End_Suc" job="/sos/jitl/JobChainEnd"   next_state="Success" error_state="Error"/>
          <job_chain_node  state="End_Err" job="/sos/jitl/JobChainEnd"   next_state="Error"   error_state="Error"/>
          <job_chain_node  state="Error"/>
          <job_chain_node  state="Success"/>
      </job_chain>
      
      

      Dynamic Critical Path Activation 

      ...

      Some business process are dependent on other business process's outcome or a an incoming file. A job chain can be configured to monitor a directory and would start as soon as a file matching with the regular expression found in the directory. So for example usually the file arrives every day before 05:00 am 00am and the job chain finishes completes successfully at 09:30 AM30am, but due to unexpected circumstances if the file arrives later then the than usual time it may be desirable that even though file arrives late the job chain should finish complete at its usual time.

      • In such a an exceptional situation the job chain can have the first node of the chain which checks check the current time and if it finds late arrival of the file , triggers the job activate_critical_path.job.xml for then triggers the Skip order for a specific job chain.
      • Once process finishes processing completes successfully the last node of the job chain can start the job deactivate_critical_path.job.xml which the Unskip which will reset the job chain status back to normal operation with all the jobs set to be executed. 

      Example Job Chain

      Code Block
      languagexml
      titleJob chain critical path Dynamic
      collapsetrue
      <?xml version="1.0" encoding="iso-8859-1"?>
      <job_chain  orders_recoverable="yes" visible="yes" title="JobChainA" max_orders="3">
          <job_chain_node  state="Start"                    job="/sos/jitl/JobChainStart" next_state="-100" error_state="End_Err"/>
          <!-- following job will check if its required to activate the critical path --> 
         <job_chain_node  state="activate_critical_path"   job="/sos/operations/activate_critical_path" next_state="-100" error_state="End_Err"/>
          <!-- non critical job step , when critical path is active following job will be skipped -->
          <job_chain_node  state="-100"                     job="01_TaskA1"               next_state="200"     error_state="End_Err"/>
          <job_chain_node  state="200"                      job="01_TaskA2"               next_state="-300"    error_state="End_Err"/>
          <!-- non critical job step , when critical path is active following job will be skipped -->
          <job_chain_node  state="-300"                     job="01_TaskA3"               next_state="400"     error_state="End_Err"/>
          <job_chain_node  state="400"                      job="01_TaskA4"               next_state="500"     error_state="End_Err"/>
          <job_chain_node  state="500"                      job="01_TaskA5"               next_state="End_Suc" error_state="End_Err"/>
          <!-- following job will  deactivate the critical path if activated by the first node--> 
          <job_chain_node  state="deactivate_critical_path" job="/sos/operations/deactivate_critical_path"     next_state="End_Suc" error_state="End_Err"/>
          <job_chain_node  state="End_Suc"                  job="/sos/jitl/JobChainEnd"   next_state="Success" error_state="Error"/>
          <job_chain_node  state="End_Err"                  job="/sos/jitl/JobChainEnd"   next_state="Error"   error_state="Error"/>
          <job_chain_node  state="Error"/>
          <job_chain_node  state="Success"/>
      </job_chain>