Show TOC

Background documentationJob Chain Steps Locate this document in the navigation structure

 

Job chain steps are executed in sequence. They contain jobs that may be executed in parallel. Steps may also have precondition functions that control whether they are executed or not. Steps may also define their own status handling that controls what happens when a job goes into a final status that is not Completed.

The attributes of a step are:

  • Name - name of the step

  • Description - description of the step

  • Comment - comment of the step

  • Precondition - start condition (as an expression that should evaluate to true if the step should run)

  • Final Status Handlers - the actions to take when all jobs have reached a final status

Precondition

Steps have a single, optional precondition function. A step with no precondition always executes. A step with a precondition only executes if the precondition returns true. If the precondition returns false, then the step is skipped.

The precondition is an expression in Redwood Expression Language.

Final Status Handlers

Final status handlers of job chain steps control the behavior of the step when all jobs in that step reach a final status. When this is the case, the step status handlers are evaluated. If the step does not define a matching handler, then the chain handlers are consulted.

Status handlers are evaluated as follows:

  • An Otherwise handler will always trigger (even if there aren't any jobs)

  • A 'Completed' handler triggers only if all jobs reached status Completed

  • A 'Cancelled/Error/Killed/Unknown' handler triggers when there is at least one job chain job with that status.

If no status handler overrules the default, the default setting is followed.

The default setting is as follows:

  • If all jobs of the step reached status Completed continue with next step or if this is the last step set the job chain to Completed.

  • If any of the jobs of that step reached any other final state than Complete, set the step and parent job chain to Error.

To customize the behavior, the following actions are available:

  • Status - The status the job chain, step or job must reach.

  • Action - The action to take when the step reaches a given status can be:

    • Goto Step - go to another step within the job chain

    • Raise Error - raise an error by returning the Return Code

    • Mark Completed - change the status of the step to completed

    • Request Restart - send operator message to choose a restart option and put the job to status Console

    • Restart Step - restart the current step

    • Restart Chain - restart the chain

    • Continue - continue with the processing of the chain

  • Message - the error message to show when the action is set to Raise Error

  • Error Return Code - the error code to raise when the action is set to Raise Error

  • Goto Step - the step the Goto Step refers to.

The default processing order of final status handlers is as follows:

  1. Canceled => On Cancel status handler

  2. Error => On Error status handler

  3. Killed => On Killed status handler

  4. Unknown => On Unknown status handler

Otherwise is always last

The order of the status handlers can be changed via scripting, please note that any status handler coming after Otherwise will be ignored.