Job Step Exit Status

In a task-oriented script module or pipeline for a custom job step, you can create an object of type dw.system.Status to control the exit status and error message for the step. The Status object includes a boolean flag that indicates whether or not the status is error, and also a status code and message. Messages appear in Business Manager and are written to log files. You can't define the exit status for a chunk-oriented script module. Chunk modules always finish with either OK or ERROR.

Rules for Continuing Job Execution

The job framework uses the following rules to detect the step status and determine if job execution can continue.
dw.system.Status.isError() dw.system.Status.getCode() Status Code Error Status Flag Job Execution Behaviour (if not handled by a transition) Notes
n/a n/a OK False Continue

False n/a OK False Continue

False OK OK False Continue

False <CUSTOM> <CUSTOM> False Continue

Custom status codes can't:

  • Contain any comma (,) or wildcard (*) characters.
  • Include leading or trailing whitespace.
  • Exceed 100 characters.
True n/a ERROR True Stop

True ERROR ERROR True Stop

True <CUSTOM> ERROR True Stop

Custom status codes for statuses that represent an error are not supported. If a custom status code is used the code is replaced with ERROR.

Rules When No Status Object

If a pipeline or script module does not return a dw.system.Status object or if a pipeline or script module's function fails before a Status object is returned, the following rules apply.

Pipeline Status Code Error Status Flag Job Execution Behaviour (if not handled by a transition) Notes
Finished with stop node ERROR True Stop  
Finished with interaction node ERROR True Stop  
Finished with unhandled exception ERROR True Stop  
Finished with end node OK False Continue The name of the end node isn't relevant
Stores an object that isn't a dw.system.Status object under key ExitStatus in pipeline dictionary OK False Continue  
Stores no object under key ExitStatus in pipeline dictionary OK False Continue  
Script Module Function Status Code Error Status Flag Job Execution Behaviour (if not handled by a transition) Notes
Finished with unhandled JavaScript exception ERROR True Stop  
Runtime exceeds configured (or default) timeout ERROR True Stop  
Returns an object that isn't a dw.system.Status object OK False Continue  
Returns no object OK False Continue