Sub-processes can be used to run a process as a part of another process.
Add a sub-process
Adding a meeting sub-process (Fig. 1) to the opportunity process.
-
Place the Sub-process element on the diagram after the “Add opportunity” element.
-
On the element setup area, in the Process field, select the process that must be run on executing this element (Fig. 3).
-
Save the process diagram.
As a result, when the parent opportunity process is run, the items preceding the sub-process will be completed first, then the sub-process (meeting with client) will be started. After the sub-process is completed, the parent process will continue (Fig. 4).
To make the parent process execution depend on the subprocess result, add parameters that will be used for creating outgoing conditional flows of the sub-process element.
Obtain subprocess execution result
The parent process can pass parameter values to its sub-processes and get subprocess parameter values. Corresponding custom parameters must be added both to the parent process and the sub-process.
To pass parameter values between the processes, first add corresponding custom parameters to both processes.
Add a parameter
To add a parameter to the meeting process (Fig. 2)
-
Open the “Meeting with customer” process for editing and double-click on the working area of the Process Designer.
-
In the Actions menu of the Process Designer, select Process parameters command.
-
Click the Add parameter button and select the Lookup menu item.
-
Populate process parameter properties (Fig. 5):
-
Enter the parameter name.
-
In the Lookup field, select the Activity result lookup.
-
Specify the value source of the parameter.
-
Click the Value field and select Process parameter in the value menu.
-
Select the Activity result parameter of the Call customer element as a source of the process parameter value (Fig. 6).
-
- Click the Select button of the parameter value window.
-
Save the process parameter.
-
Save the process.
As a result, whenever the Call customer element is completed, its result will be passed to the process parameter.
Obtain results
To specify conditions for the conditional flow that originated from the Sub-process element in the parent process (Fig. 2):
-
Open the parent process where the end parameter of another sub-process should be handled.
-
Add conditional flow from the Sub-process element to the Open edit page element that open a new document page.
-
Click the Condition to move down the flow field.
-
In the parameter value window, specify the condition for moving down the flow that compares the sub-process resulting parameter with the expected value (Fig. 7):
-
On the Process elements tab, select Meeting with customer.
-
Select the Conduct meeting process parameter.
-
In the formula area, enter “==”.
-
On the Lookup tab, select Result of activity lookup from the dropdown list.
-
Select Completed.
-
-
Save the changes in the parameter value window.
-
Add a default flow from the subprocess element to the end process event element (Fig. 8).
-
Save the process diagram.
Use an event sub-process
You can set up business processes containing task combinations that can be repeated several times during the process execution, when certain events occur. To arrange such task combinations in a separate process flow, use the Event sub-process element in your diagram.
For example, within a sale process, order information must be updated at every stage of negotiations (Fig. 9).
To set up a process containing an “Order modification” event sub-process:
-
Add a Throw message intermediate event to the process diagram after the corresponding process action. Populate the Which message to generate? field with the message name that will serve a trigger of your event sub-process, e.g. “UpdateOrder” (Fig. 10).
-
Add the Event sub-process element to the diagram and set up the elements on it (Fig. 11):
-
Add a Message start event in the Event sub-process area on the diagram, as the initial event of your event sub-process. Make sure that the value in its Which message event should start the process? field matches the value of the message generated by the corresponding Throw message event (Fig. 12).
-
Add subprocess steps to the diagram For example, add an Open edit page element that opens the order page for the user and a Send email element to notify all involved parties that the order has been updated.
-
Connect the event sub-process elements with sequence flows.
-
-
Save the process diagram.
As a result, the event sub-process will launch each time the Throw message intermediate event of the current process generates a corresponding message during the process execution. For example, an order modification sub-process will run whenever an order modification message is received within the process.