Applies to version 2019.1; author: Konrad Wojtycza
From the point of view of business requirements, a common need is the approval of the document by people on the designated approval path. WEBCON BPS introduces functionality that simplifies the configuration of your approval workflow – a list of items. A person authorized to approve can edit only the line to which they are assigned.
As for all other tasks, the settings for simultaneous execution of tasks determine whether the instance must be approved by one of the people indicated on the approval path or all indicated people. The second situation can be divided into a scenario in which a task is assigned to all people approving the instance and the same time and a scenario in which people from the approval path verify them one by one. This article describes the configuration of all three scenarios.
The “Purchase order” workflow
The “Purchase order” workflow contains the “Approval completed?” control step – all indicated people must approve the instance.
Fig. 1. The “Purchase order” workflow
The configuration of the approve path with the blocked rows
The Approval path contains the item lists with the active approval function. Start the configuration from adding the form fields to the item list – in the simplest case they could be the item list with the checkbox columns (Fig. 2) and choice field (Fig. 3).
Fig. 2. The column settings with the checkbox form field
The “Approved?” column with the checkbox will be used to confirm the approval of the document by the approvers. The default value for the checkbox should be defined as FALSE.
Fig. 3. The column settings with the select form field
The “Approver” column with the choice list – autocomplete will be used to select the approvers on the registration step. Determining the approvers can also be realized without the user’s participation by using the “Change item list value” action. The “Use people field data source” checkbox is marked in the parameters, so that the “Approver” field allows people belonging to the organization’s structure (most often from Active Directory) to be selected.
Enabling the approval functionality is possible in settings of a specific step in the Forms tab. This should be the step at which people approve the document – in this case it is the “Purchase order approval” step (Fig. 4).
Fig. 4. The configuration of the form at the “Purchase order approval” step
Approval settings on the item list are available after clicking on the tools icon, at the level of the name of the “Approval path” item list (Fig. 5). The approval functionality is possible in the “Acceptance” tab.
After selecting the “Active” checkbox you can edit the approval settings. In the “People that have rights to accept” section you can define all approvers. They can be defined based on the column rules in the item list (the “Dynamically” option). In this case, the “Approver” column stores the approvers’ data, so the picker value should be set to ‘login’. It is also possible to return approver logins using the SQL/CAML query (logins). When you select the “Data source” option, you can define a data source that contains approver’s logins.
Fig. 5. The approval settings on the item list
In the “Appearance” section you can define if the rows editable by approvers other than the approver currently editing the instance should be hidden (Hide not available rows) or visible as a read-only rows (Show not available rows as read-only). You can also set the background color of the rows of the item list that will be editable by the user that edits the instance (Change colors of available rows).
Instance approval by all people from the list at the same time/one person from the list
If all people at the same time or one person from the list should approve the instance, it is necessary to assign a task using an SQL query on the path following the approval step (the “Purchase order approval” step).
In the task configuration, if you select the “Completion – Any” in the “Parallelism” field (Fig. 6) – a task will be assigned to all people selected by the SQL COMMAND query and the instance goes to the next step after approving by all people.
Fig. 6. Task creation settings
In the SQL COMMAND query configuration (Fig. 7), select the “Return values from all rows” option in the “Number of rows to return” field. The query will return all people from the “Approval” path.
Fig. 7. The query returning all people from the Approval path
Instance approval by subsequent people
If the instance is approved by subsequent people, you should define the task creation action on entry to the approval step (Fig. 8.).
In this action, people are selected from the “Approval path” item list which uses the SQL COMMAND query. In the SQL COMMAND, select the “Return value from the first row” option from the “Number of rows to return”. The query will return the only first person (Approver) who has not yet approved a request (Approved? = 0) in the order they were added to the list (ORDER BY DET_ID).
Fig. 8. The configuration of the action of creating the “Assign task to Approvers” task
Additionally, after exiting the “Purchase order approval” step, define the flow control step which, after checking if there are still people who have not approved the instance on the “Approval path”, will return the instance to the “Purchase order approval” step or to the next steps (Fig. 8).
Fig. 9. The flow control step
The SQL query in the flow control step returns 1, if there is a person who has not approved the instance on the “Approval” path.
The form with the approval list with blocked rows
Figure 10 presents the item list with the approval functionality when the instance is edited by the person who has access to approve.
Fig. 10. The form with the item list
The functionality of approving on the item list significantly facilitates the document approval presentation by required people on the form, and also allows you to configure the process to business needs. In addition to presenting the approval process, it can also help define the course of the approval path.