Applies to version 2020.1.3; author: Dawid Golonka
In the WEBCON BPS system, the processed instances move from one workflow step to another. Tasks are assigned in these steps, and users or groups of users assigned to these tasks must perform an action. WEBCON BPS has a comprehensive tool that allows you to choose who the task should go to in the next step; it is configured in the ‘Task assignment’ tab on the path that links two steps.
However, this is not the only way to assign a task to the user. This article discusses how you can use the “Choose an approver” action to assign a task. This action allows for greater flexibility when selecting the approver because you can enable the user to send the task to their direct supervisor or assign it to the approver based on any condition you define.
To present this action’s configuration and operation, we have created a workflow for declaring the requisition for office supplies.
The start step is completing a requisition form on which the user indicates who should be the approver, what item is requested, and what is its cost. In the second step, the requisition is accepted by the selected approver.
There are two options for choosing the approver: a) the form is sent to the direct supervisor of the person who submits it, and b) the approver is selected based on a predefined condition he or she meets.
We have created three BPS user accounts for our business case that reflects our sample department’s structure.
Choosing the direct supervisor is a handy option when you register a form on someone else’s behalf. Please note that by default, the form is sent to your supervisor.
Using this built-in action (called “Choose an approver”), you can assign the task on the next step to the supervisor of any person whose data is on the form.
In our example, on the form in the registration step, we enter the employee’s data for whom the equipment will be ordered and then complete the information about the items they need. Then, we hit the “Register” button.
Now, the action “Choose an approver” is executed on the path called “Register” (belongs to the “Start” step). Here, the task is assigned to the person’s direct supervisor.
However, before it can happen, we should press the “Configure” button to configure the action. Below you can see the complete configuration used in our example.
In the “Select user” field, we have chosen the “Purchaser Login” form field because we want to send the form to the supervisor of the person who completes a requisition form. In the “Target field,” we should choose where we want to store the information about the supervisor who can approve the form. We have chosen a field named “Approver.” Please note that you need to create this field before you can select it. Once you have entered all information, save the configuration.
Then, we need to go to the “Paths” tab, select the path we are using in this configuration (here, it is “Register”), and on the right, click on the “Task creation” tab. Here, we go to the “Tasks assignment” section, tick the “Business Rule,” and add the “Approver” form field in it. Now, the form can be sent to the supervisor of the person who registers it.
Please note that here you should use the name of your form field in which you store information about available approvers. Its name may be different than the “Approver.”
Now, we should check if our configuration is working correctly. As you can see in the screenshot below, after Adam Nowak registered his requisition, the form was correctly sent to his direct supervisor Michał Kot who decided to approve it.
In the advanced variant, the supervisor’s choice will additionally depend on the total value up to which they can accept purchase requests.
The “Employee Limits” dictionary workflow has been created, in which each employee can be assigned the maximum amount to which they are authorized to approve purchases.
For Michał Kot, the approval limit was set at PLN 99:
For his supervisor, the total value of requisition he can approve is up to PLN 500:
The “Choose an Approver” action configuration now looks like this:
The part of the configuration responsible for selecting the user and the form field where we save this information remained unchanged. However, the choice of the method of acceptance has been changed. Using the advanced supervisor selection, you must provide the conditions that must be met in order for the currently checked supervisor of a given employee to be selected as an Approver. The action checks the superiors one by one, i.e., when the direct superior of a given employee does not meet all the conditions, the supervisor who is one-rank higher than him or her is checked.
In the described case, the condition checks if the value in the “Order value” form field is less than or equal to the value declared as the maximum requisition value a given supervisor can accept. For the condition to be considered fulfilled, it must return “1” or “True” in the first column, in the first line of the query response.
Let us comment on the function in figure 12 now. The value “Limit” reads the approval limit set for the superior who is being checked at the moment. The ‘## login ##’ tag allows access to the superior’s login.
Now, we should test our configuration. To do so, the purchase of office supplies for Mr. Adam Nowak was registered. The value of the order does not exceed PLN 99.
As you can see, the task was assigned to Adam Nowak’s direct superior:
Another check of the functionality will be submitting a requisition for products with a total value higher than PLN 99 but lower than PLN 500. In this range, there is a superior (Zbigniew Kowalski) who can accept such requisitions.
After going through the registration path, you will notice that the task has been assigned to Zbigniew Kowalski. The value of PLN 200 exceeded Michał Kot’s privileges, but it was appropriate for a higher-rank superior.
In our examples, the value of requisitions has not exceeded the approval limits for the defined superiors. However, if an employee submitted a requisition with a total value exceeding PLN 500, there would be an error because we have not defined a superior eligible to accept such a purchase.
Fortunately, the “Choose an Approver” action enables error handling. When you configure this action, open the “No value behavior” tab to set the settings for handling errors. In our example, an error is a situation when none of the superiors meet the conditions, and there is no person eligible to accept a requisition with a certain total value.
We have entered a sample error message and, after that, submitted a requisition for office supplies that exceeds PLN 500:
As you can see, our error message (in red) was displayed to the person submitting the form.
The message informed the user about the error; however, this solution means that the item’s processing may get stuck at this point.
To avoid such a situation, we can indicate who should receive the task of approving the requisition if there is no eligible approver (the requisition’s total value exceeds their approval limits). In our example, we have chosen that it should be assigned to Borys Szyc.
As you can see in figure 20, you can select a user manually or from a form field; another option is using a SQL/CAML query to return them.
Now, we will again submit a requisition for buying a laptop. Its value will exceed our defined superiors’ approval limits, causing an error; thus, the task should be assigned to the user indicated in the error handling configuration. In our example, it is Borys Szyc. As you can see on the screenshot below, the configuration is working properly.
This article describes the operation of the “Choose an approver” action, which extends the functionality of assigning tasks in the WEBCON BPS system. We have described the action’s basic mode (assigning the task to the direct superior) and its advanced mode (assigning the task to a superior that meets predefined conditions).
This action also allows error handling for assigning tasks, thanks to which the user will receive information about the reason of the failure. However, this may cause the form to get stuck at one of the workflow’s steps. To avoid such a situation, you may configure who the task should be assigned to if there is no eligible approver.
If you want to learn more about task assignment, here are the recommended articles on this topic:
Parallel task assignment (webcon.com)
Predefined task assignment (webcon.com)
Task assignment – business rules (webcon.com)
Assigning tasks to BPS groups (webcon.com)