How do I trigger a request in a sub-process in Cflow?
Trigger new process – Select the action type ‘Trigger new process‘ if you want to trigger a new request in the current workflow or different workflow. Specify the conditions and select the workflow to trigger a request. A sub-process is a secondary workflow that is linked to a primary workflow and is triggered either when a request in a primary workflow is submitted or based on rules defined in any of the process stages. A request created in the primary workflow typically moves through several stages, you can define rules in any of the stages to initiate a new request in sub-process. To configure a trigger in Cflow, follow the steps given below:
- Specify the field mappings between the triggered workflow and the current workflow. The values from the current request will be automatically assigned to the triggered request based on the mappings specified.
- Turn on ‘Allow progress only after sub-processes complete‘ if you want to move the request in the current workflow to the next stage only after the triggered request has completed processing and reached the End Stage.
- Turn on ‘Submit triggered requests‘ if you want to submit the triggered request immediately. The rules for the triggered request will be evaluated and the appropriate action (Move, Set Field Values, Trigger) will be performed. Click on Save to save this configuration.
For example, imagine a situation where you want to trigger the Work Order workflow from the Task Assignment Process workflow. The values from the Task Assignment Process workflow will be automatically assigned to the Work Order workflow based on the mappings specified. Turn on the toggle Submit Triggered Requests to submit the Work Order workflow immediately. If you want to move the request to the next stage in the Task Assignment Process workflow only after the request in Work Order workflow has reached the end stage in such a case turn on the toggle ‘Allow progress only after sub – processes complete.
The initiator of the triggered request is assigned as follows:
- The reviewer of the stage in primary workflow from where the triggered request is initiated. This is the default behavior.
- The initiator of the triggered request can be assigned using the @@initiator keyword. This can be set to the initiator of the primary request or to any field in the primary workflow.
You can pick the value of the @@initiator from the primary workflow so that when a request is submitted it shows the username who has submitted the triggered workflow.
Let’s say you want to trigger the request in a new workflow after Developer has approved the request but you want the initiator to be the initiator of the primary workflow, in such a case, you can pick the value of initiator of the triggered workflow from the primary workflow as shown below.