Configuring flow exit codes
By default, a Done job has an exit code of 0. As a result, a Done flow or subflow has an exit code of 0, since the default way that Process Manager determines the flow exit code is through the sum of all exit codes of all work items in the flow.
However, it is possible to specify custom success exit codes for LSF® jobs, job scripts, local jobs, and manual jobs. As a result, if you specify custom success exit codes for these types of jobs, a Done flow can have an exit code other than 0.
If there is more than one Done job with an exit code other than 0 in a Done flow, or there are some jobs with Done or Exited states with codes other than 0 in a failed flow, the sum of all exit codes may not be meaningful to you.
For such cases, you can configure the flow to inherit the exit code of the last item that was successfully completed or that failed. You can do this in the Flow completion Attributes dialog, with the option Determine the flow exit code from the last finished work item in a successful flow, or the last failed work item in a failed flow.
How the system selects the last finished or failed work item:
- If more than one work item finishes or fails last and at the exact same time, the system picks an item at random to get the exit code.
- If you select Change the flow state immediately and continue running the flow the system does not consider jobs that finish or fail after the flow state was changed.
In combination with the other options in the Flow Attributes dialog, you can configure your flow to have an exit code that makes sense to you.
Configure flow exit code calculation
Procedure
Configure dependencies for subflows
About this task
If your flow has subflows, when creating your flow, you want to establish a dependency between the subflow and other work items to track when flow completes successfully with a specific exit code, or when a flow fails with a specific exit code.