Applies to version: 2021.1.x and above; author: Konrad Wojtycza
Introduction
Workflow control (Branch) allows to redirect a workflow instance along a selected path. With the help of the workflow control step, we can among other things set the logic of:
• skipping steps,
• assigning a task to other people, e.g. in the case of approval,
• withholding instances in step until the conditions are met.
This article presents two workflows that use workflow control step:
1. Acceptance workflow (1), in which the workflow control step bypasses the department manager approval step if the number of vacation days requested is less than three,
2. Accounting workflow (2), in which the workflow control step returns the instance to the approval step until the invoice is accepted by all required persons.
This article is an update of an older article on the same subject.
Fig. 1 Flow diagram of the "Leave request" workflow
Fig. 2 Diagram of the "Accounting" workflow
Configuration of the "Leave request" workflow
The form of the Leave request workflow applications is visible below:
Fig. 3 Form of the Absence process workflow
The workflow control step is named "MGMT acceptation?" (Fig. 4) which has two paths. One of them leads to the approval of the employee's manager (Fig. 5), and the other directly to the "Entry to HR system" system step, where an entry into the HR system is made (Fig. 6).
Fig. 4 Configuration of the Leave request workflow
Fig. 5 Configuration of the "Yes - to Manager acceptation" path on the "MGMT acceptation?" step
Fig. 6 Configuration of the "No - to HR system" path on the "MGMT acceptation?" step
The correct workflow control step configuration can be found in the Flow control tab (Fig. 7). In the "Path selection business rule", define a rule that will return the path leading to the next step. In this case, if the number of days off is greater than three, the leave request will go to the manager's approval step. Otherwise, the application will go directly to the "Entry to HR system" step.
Fig. 7 Workflow control configuration on the "MGMT acceptation?" step
In the presented example, the Manager acceptation step was omitted because the number of days off requested did not exceed three (Fig. 8).
Fig. 8 Sample form of the "Leave request" workflow. After the Project manager approval, the instance bypassed the "PM approval" step and went directly to the "Entry into the HR system" step
Configuration of the "Accounting" workflow
The form of the Accounting workflow is visible below:
Fig. 9 "Accounting" form
"All approved?" is a workflow control step. It returns workflow instances to the approval step until all required persons have approved the invoice. The invoice approvers visible in the Approver (Fig. 9) column are assigned to individual accounts of the analytical breakdown.
Fig. 10 Configuration of the "Accounting" workflow
Workflow control configuration on the "All approved?" step (Fig. 11) has been defined in such a way that if there is a person for which the value of the line "Accepted" will be "No" on the "Analytical breakdown" item list (Fig. 9), then the instance will be moved along the path “(system) to Approval " to the Accept step. Otherwise, the instance will go to the "Booked" step along the "(system) to Booked" path.
"All approved?" rule used to enforce this logic has been presented on Fig. 11.
Fig. 11 Workflow control configuration at the "All approved?" step
Fig. 12 Workflow control configuration on the "All approved?" step - the "All approved?" rule
On the "(system) to Approval" path (Fig.13) the rule "to remaining Approvers" (Fig.14) selects approvers who have not yet accepted the invoice.
Fig. 13 Configuration of the "(system) to Approval" path on the "All approved?" step
Fig. 14 Rule configuration "to remaining Approvers"
Summary
The workflow control step is a necessary functionality in the system that is based on workflow instances.
It will be used wherever the workflow depends on various conditions resulting from business logic.