Versions Compared

Key

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

...

  • Use Case:
    • Consider the situation where:
      • A job chain is to start at a certain point in time and after an arbitrary number of other parallel job chains have been completed successfully.
      • The predecessor job chains run in an arbitrary sequence at arbitrary points in time.
    Example:
      • Subsequent jobs in started job chains check if jobs from parallel chains completed successfully
    • Job chain Z runs after 2 other job chains A and B have completed
      • .

Solution

  • Download: final_chain_job_chain_history.zip
  • Extract the archive to a folder in your JobScheduler installation named ./config/live.
  • The archive will extract the files to a sub-folder final_chain_job_chain_history. 
  • Note that you can store the sample files in any folder you like.

Pattern

Flowchart
# order_A [shape="ellipse",label="Order A\n start time: Friday 08:00 ",fillcolor="violet"]
# order_B [shape="ellipse",label="Order B\n start time: Friday 07:00 ",fillcolor="violet"]
# order_Z [shape="ellipse",label="Order Z\n start time: Friday 15:00 ",fillcolor="violet"]
 
job_chain_A1 [label="Job Chain A1\nhas no relevant dependencies",fillcolor="orange"]
job_chain_B2 [label="Job Chain B\nhas no relevant dependencies2\nis started by Job Chain 1",fillcolor="orange"]
job_chain_Z3 [label="Job Chain Z\ndepends on the execution of\nJob Chain A and3\nis started by Job Chain 1",fillcolor="orange"]
job_chain_4 [label="Job Chain 4\nis started by Job Chain B1",fillcolor="orange"]

job_checkchain_predecessor5 [label="Job check_predecessorChain 5\nis started by Job Chain 1",fillcolor="lightskyblueorange"]
job_next_jobchain_6 [label="Job Chain 6\nis started by Job Chain 4",fillcolor="orange"]


split1 [label="Split 1", fillcolor="lightskyblue"]
job1 [label="Next Job"Job 1", fillcolor="lightskyblue"]
job2 [label="Job 2", fillcolor="lightskyblue"]
check_predecessor_successful [shape=diamond,label="execution successful\nfor Job Chain A and Job Chain B?",fillcolor="white"]
order_setback [label="Set back Order",fillcolor="white"]

order_A -> job_chain_A
order_B -> job_chain_B
order_Z -> job_chain_Z
job_chain_Z -> job_check_predecessor
job_check_predecessorsync1 [label="Sync 1", fillcolor="lightskyblue"]
job1_2 [label="Job 1.2", fillcolor="lightskyblue"]

job3 [label="Job 3", fillcolor="lightskyblue"]
job4 [label="Job 4", fillcolor="lightskyblue"]

job5 [label="Job 5", fillcolor="lightskyblue"]
job6 [label="Job 6", fillcolor="lightskyblue"]

job7 [label="Job 7", fillcolor="lightskyblue"]
job8 [label="Job 8", fillcolor="lightskyblue"]
job9 [label="Job 9", fillcolor="lightskyblue"]

job10 [label="Job 10", fillcolor="lightskyblue"]
job11 [label="Job 11", fillcolor="lightskyblue"]
job12 [label="Job 12", fillcolor="lightskyblue"]

job13 [label="Job 13", fillcolor="lightskyblue"]

job_chain_1 -> split1
split1 -> job1 -> sync1 -> job1_2
split1 -> job2 -> sync1 -> job1_2
 
job1 -> job_chain_2 -> job3 -> job4
job2 -> job_chain_A
job_check_predecessor3 -> job5 -> job6

job1_2 -> job_chain_B
job_check_predecessor4 -> job7 -> job8 -> check_predecessor_successful
check_predecessor_successfuljob9
job1_2 -> job_next_job [label=" yes "]
check_predecessor_successfulchain_5 -> job10 -> order_setback [label=" no "]
order_setback job11 -> job12


job9 -> job_check_predecessorchain_6 -> job13
 
 

Implementation

Components

  • The solution contains three job chains:
    • job_chain_A and job_chain_B represent the predecessor job chains that have no relevant dependencies with job_chain_Z.
    • job_chain_Z is the final job chain that checks if job_chain_A and job_chain_B have already been executed successfully.
  • The solution implements a job check_predecessor_job_chain_Z that has been added at the start of job_chain_Z.
    • This job makes use of a parameter check_job_chains 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.
      • Example:
        • check_job_chains = job_chain_A;job_chain_B
    • This job implements a spooler_process() function that reads the parameters and checks the job cahin history for successful execution of the job chains specified by the parameter.
    • Should all checks for previous successful execution provide a positive result then the current order will be moved to the next job chain node. Otherwise the current order is set back and will be repeated regularly according to the setback configuration for this job.

...