As described in Creating a Workflow, a workflow
is a series of tasks, together with the participants and the logic
required to execute the tasks. A
subflow is a workflow that is a child of a parent workflow. You can use subflows to refactor
a larger
workflow template into smaller components. Grouping elements together into a subflow helps organize
and reuse business logic. Using subflows improves readability of the workflow template
and promotes consistent reuse of business logic within the organization.
To create a subflow,
follow these steps:
-
In the diagram editor, right-click on the task that you want to convert to a subflow
and then select the Create Subflow from option.
-
When prompted, select
one of the following options:
-
Select OK to save the subflow definition.
For each option, the
relevant diagram opens. For the Create New selection,
the diagram is blank and untitled. For the other options, the diagram
is a copy of the existing designated template.
The original parent workflow elements remain visible in the workflow tree.
After an element is added to the new diagram, the transformed task is denoted with
the process icon (
) in the workflow tree. The subflow data objects, statuses, policies, and participants
are also visible in the workflow
tree hierarchy.
After adding a subflow, the task symbol in the parent workflow becomes a stacked icon
representing a set of tasks rather than a single step in the
template. The following figure shows an example of subflow notation: