In every submap there is a return to the calling map, either an implicit (automatic) return at the end, or an explicit step with a Return system function. Upon return to the calling map, the processing continues either (a) at the state it was in when the submap was called or (b) the next state, depending on the settings of multiple options as described below. See Return system function for instructions for using the Return system function.
The following example illustrates the behavior of the implicit return from a called submap.
Return from submap | Details |
---|---|
![]() |
In the illustration, StepS is a submap step that calls map Submap1. At runtime, when Submap1 completes, the processing automatically returns to the calling map—it is not necessary to use a step with a Return system function. The implicit return from a user-defined submap always returns to the calling map at the stage immediately following the stage where it was called. A workflow author can optionally place a step with a Return system function on a map to return to the calling map prior to completion of the submap. TIP When the calling entity is a submap step or a Call system function, any Return system function on the called map should have the Return expression set to false so that processing will continue after the submap step, rather than repeat the call to the submap. |
In addition to submaps for regular processing, there are also maps called when a timer expires or when an exception occurs during processing. These maps can have a different behavior for the implicit return. The workflow author can also add a step with a Return system function to control the return.
The following example illustrates the return from an Exception (Malfunction) map that contains a Return system function.
Malfunction map | Details |
---|---|
![]() |
In the illustration, the workflow has an assignment expression (A) specified before StepX. The default Malfunction map has been modified to include a Return step with the Return expression = true. This map controls the return for any exception. At run time, if the assignment expression at stage A results in an error (as indicated by #), the work item goes to the Malfunction map. An example of an error is division by zero. A workflow administrator can correct the error (by modifying the data to an appropriate value) and save the change. In this example, the Return expression for the Return system function is true. Therefore, the processing resumes in the calling map right before the Assignment stage and repeats the assignment expression. If the administrator corrects the problem, the assignment is made, StepX executes, and the workflow continues as expected. If the Return expression was set to false in the workflow definition, the processing would resume right after the Assignment stage, skipping the assignment expression, and then executing StepX. Note that if subsequent processing depends on the value of the assignment, the results might not be as expected. |
Two factors determine which case occurs upon return to the calling map:
and
Following is a summary of Return system function behavior based on these two factors. It also includes the behavior of the implicit return from the maps where there is no specific Return step.
Return expression (Retry) | Map containing Return | Consistent Return enabled (default) | Consistent Return disabled (legacy) | |
---|---|---|---|---|
Return system function (Specific step with Return system function) | true | Called map (submap) | Repeat | Repeat |
Exception map | Repeat | Repeat | ||
Expired timer map | Repeat | Repeat | ||
false | Called map (submap) | Skip | Skip | |
Exception map | Skip | Skip | ||
Expired timer map | Skip | Repeat | ||
Implicit return (Return implied after last step on the map) | N/A | Called map (submap) | Skip | Skip |
Exception map | Skip | Skip | ||
Expired timer map | Skip | Repeat |
TIP In FileNet® P8 Process, when the Consistent Return flag is true (default setting), the implicit return always returns with a value of false (skip).
In a submap called from a Submap step (or a Call system function), avoid using a Return system function in a path that is outgoing from an AND-split step and incoming to an AND-join step. Since a work item exists for each path outgoing from an AND-split, using a Return in this case can result in the creation of extraneous work items. For further information about AND-split and AND-join steps, see System step - routing properties.
Related information: Fixing workflow exceptions for empty workflow groups