Understand exactly how substitutions work in WEBCON BPS. More advanced uses of substitutions in WEBCON BPS.
This is already described!
On the subject of substitutions, there are already two articles on the WEBCON BPS technical blog. The first of them talk about how the substitution mechanism works, the second updates this knowledge with new substitution functionalities present in the WEBCON BPS 2019 version. This basic knowledge is sufficient to start using substitution functionality in your applications.
However, if you are interested in what kind entries are made in the database and how you can use this knowledge in creating advanced business processes – I am inviting you to continue reading.
Tasks and Substitutions
Substitutions only work on tasks to be performed by a given user. In other words, if someone has read privileges to some workflow instances, but there is no task on it for him, then his substituting person will not receive read rights.
When adding tasks in WEBCON BPS, we always decide whether a given task can be done by another person with substitutions. Thanks to this, during the process configuration, we are able to indicate critical tasks that will never be performed by substituting people. The default configuration allows for substitutions.
Tasks in database
I have registered 2 tasks for the user “Test User” in the system. All tasks (both active and completed) are in the WFElementTasks table. Below is a query that allows you to list all active tasks for the user “Test User”:
As you can see our “Test User” has two active tasks in the system. He has a task with ID 35 for workflow instance with ID (WFD_ID) 522. This task can not be ended by a substituting person. The second task with ID 36 allows substitutions.
Substitutions in database
How to add and how to configure substitution activation time, you may find at WEBCON BPS technical blog(Substitutions & Substitution in WEBCON BPS 2019).
I added three substitutions and deleted one of them. The database result is shown below:
The first substitution was deleted. Cov_IsDeleted column was checked to 1 and COV_IsActive set to 0. The rest substitutions are active. Column COV_DEFID is responsible for storing information about the process ID of the indicated substitution. In case the substitution applies to all WEBCON processes, the column contains a NULL value.
You have to remember, that substitutions in WEBCOn BPS do not work instantly. After adding, changing or removing substitutions, there is a need to calculate tasks. This operation is performed by WEBCON BPS Service at the appointed time.
Let’s check how looks our table with tasks, after substitution activation time:
As you can see, there was added one more task to the WFElementTasks table. For a task with ID 36 which was allowing substitutions, was created another one for covering user (“webcon user”). The column WFT_OrgID is storing the ID of the original task. On the web form of this workflow instance this looks like below:
Upgrade SWE: Calculated column with substitutions
Unfortunately, there is no standard column in the WEBCON SWE Report witch will display who is substituting the assigned person. But with the query shown below you may do it on your own using calculated columns. This query will display every substituting user separated with semicolons.
Global Business Rule: Is user A covering B?
Sometimes in the WEBCON BPS process, there is a need to make the form dependent on the current user. For example, we want to show the transition path only to the author of the document. But what if the author of the document goes on vacation and the task is replaced by a substitute? The process will be suspended! Substituting user will not see this transition path. Below is an idea for a universal business rule that you can use to create comprehensive processes that support the functionality of substitutions.
You may create one global business rule like below and use it everywhere when your process depends on the current user context.
Below is an example of this business rule usage. Let’s assume we have already path visible for the author of the workflow instance. Now we want to show this path also for substituting coworker. This business rule may look like below. The path will be visible when the current user login is equal to the login of the author or the author is covered by the current user.
Featured image: Words Sticker Vectors by Vecteezy