Sub-process
1. Node Functionality
When a business process is a common process that can be reused, it can be configured as a sub-process for other processes to invoke, significantly reducing duplicate configuration of processes.
A sub-process can be treated as a separate workflow, and after the sub-process is executed, the data will return to the primary process.
However, a sub-process cannot be created independently; it must be created and used within the primary process.
2. Setting Up Sub-process Nodes
2.1 Selecting Data Objects
Add a sub-process node and select a data object in the primary process. The data object refers to selecting which node's data will be passed to the sub-process, and the selected node object will serve as the data source for the sub-process.
Note: The data source can be a single data entry or multiple data entries, which determines the execution method of the sub-process.
2.2 Configuring the Sub-process
If there are no selectable sub-processes, we can directly click "Save." After saving, we can enter the sub-process configuration page from the primary process.
As shown in the diagram, click on the arrow of the sub-process node.
Enter the unnamed sub-process page, which can be configured similarly to the process configuration. After configuring, click "Publish".
Please return to the main process configuration of the sub-process node, and you can select the recently published sub-process.
2.3 Parameter Passing
You can also set parameters to pass initial values to the sub-processes process parameters for use during sub-process execution.
A: Parameters can be directly set in the sub-process, referring to process parameters for updating process parameters.
B: Add parameters as sub-process parameter fields.
After setting, we can use these fields as condition parameters in the sub-process configuration.
2.4 Selecting Execution Method
If it is multiple data entries (the data object selected is the "Retrieve Batch Data" node), the sub-process can be set with two execution order options:
- Parallel: If these records must be processed individually, parallel execution is suitable. Even if one sub-process is terminated, it does not affect the execution of other sub-processes.
- Execute item by item: Each sub-process must wait for the previous sub-process to pass before triggering. If a sub-process is terminated, subsequent sub-processes will not be executed.
2.5 After the Sub-process is Executed, Proceed to the Next Node
- If selected, it will wait for the sub-process to complete before executing the following nodes. Additionally, when the sub-process data source is a single object, the subsequent node can use parameters from the sub-process.
- If not selected, the sub-process and subsequent nodes will execute simultaneously, and the execution result of the sub-process will not affect the current process.