Job dependencies

About this task

When you draw a line between two work items in the flow diagram, you are establishing dependencies between the two jobs. The default type of dependency is assigned, which is a dependency on the first job to complete successfully. However, you may want a job to run only after a predecessor job has failed, or when a job completes with a particular exit code. In these cases, you need to edit the job dependency.

You can display or hide dependency conditions by selecting View > Show Dependency Conditions, or accessing the menu from the pop-up menu by right-clicking in the flow canvas.

You can choose from the following criteria:

  • Run a job when the predecessor completes successfully
  • Run a job when the predecessor job starts
  • Run a job when the predecessor is submitted
  • Run a job when the predecessor job fails
  • Run a job when the predecessor job ends, regardless of success or failure
  • Run a job when the predecessor job overruns
  • Run a job when the predecessor underruns
  • Run a job if the predecessor fails to start
  • Run a job when the predecessor cannot run
  • Run a job if the predecessor misses its scheduled start time

Procedure

  1. Draw both the predecessor job and the job that succeeds it.
  2. Change to job dependency mode by clicking the Insert Dependency button.
  3. Draw job dependencies by left-clicking on the job that must run first, then left-clicking on the job that runs next.

    Job J2 cannot run until job J1 completes successfully. J2 cannot run until the dependency condition is met.

  4. To change the type of dependency, right-click on the dependency line and select Open Definition. The Event Definition dialog box appears.
  5. In the Event Type field, select the type of dependency you want to use to trigger the successor job, and the appropriate operator and values. See the examples that follow for job dependencies you can use.
  6. In the Description field, add any descriptive text that may be used for understanding this event. For example, if this event requires special instructions for operations staff, place those instructions here.
  7. Click OK.

Examples

Run a job when predecessor starts

Run when predecessor has exit code greater than 2

Run when the predecessor’s exit code is 10, 15, or 22

You can specify multiple exit codes to indicate to run when any of these exit codes are encountered. You specify a space-separated list of exit codes in numbers from 0 to 255.

Run when the predecessor’s exit code is not 9 or 11

You can specify multiple exit codes to indicate to run when any of these exit codes are not encountered. You specify a space-separated list of exit codes in numbers from 0 to 255.