This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with BPMN User Substitution
This section guides you through user substitution and how to work with it.
User substitution involves defining a substitute for a particular user for a given time window. This functionality is particularly useful in BPMN user tasks when the original task assignee becomes unavailable for a period of time. For example, the task assignee goes on vacation. In this case, all the tasks assigned to this user will get delayed until the particular assignee is available again and nobody else will be able to work on these tasks either. To avoid this kind of unnecessary processing delay, you can use the user substitution feature. This means that when a user is not available for a certain period of time, all tasks assigned to that user will be assigned to the defined substitute instead.
How it works
- Users are allowed to define a substitute for themselves within the time period that they are going to be unavailable.
- Once this specified period (substitution period) starts, all the existing tasks of the user are transferred to the substitute (i.e.,bulk reassignment).
- From this point onwards, any new tasks that are going to be assigned to the user will be assigned to the substitute user instead.
- The substitute user will also be added as a candidate user to all the existing tasks for which the original assignee is a candidate user.
If the given substitute is also not available (i.e., the substitute also goes on vacation), you can enable transitivity. Enabling transitivity allows the engine to try and find a transitive substitute by going through available substitution records. In this way, the engine uses the best available user as the substitute. However, if the system could not find a proper substitute (i.e., there is a cyclic dependency between substitutions), it will return an error, rejecting the substitution request. This rejection is possible only for the substitutions that start just after the substitute request. For a scheduled substitution, if the engine ends up without a proper substitute, the tasks of the user will be assigned to the ‘task owner��. If the task owner is not defined, the assignee will be removed from the tasks and it will be claimable.
EI Business Process provides REST APIs to add, update and lookup substitution information. Alternatively, you can also use the BPMN-explorer to experience all the facilities provided by substitution APIs.
Enabling user substitution
- Run the database script
<EI_HOME>/wso2/business-process/d
bscripts/bps/bpmn/create/activiti.<DB_Name>.create.substitute.sql
against your BPMN engine's database to add the Substitution related table. Open the
activiti.xml
file found in the<EI_HOME>/wso2/business-process/conf
directory and uncomment the following configuration.<bean id="userSubstitutionConfiguration"> <property name="enabled" value="true"></property> <property name="enableTransitivity" value="false"></property> <property name="activationInterval" value="60"></property> </bean>
Property | Value | Description |
---|---|---|
enabled | true | Set to true to enable the substitution feature. |
enableTransitivity | true | Set to true to enable substitution to transitive substitutes if the provided substitute is not available, as explained above. |
activationInterval | <scheduler running interval in minutes> | A scheduler is running to activate scheduled substitutions and update transitive substitutes if transitivity is enabled. Specify the time interval in minutes that the scheduler should run. The scheduler activates a given substitution in the time frame specified here. |
Permission Scheme
Each valid user has permission to add update and view his/her own substitution records and to view the substitution records where he/she acts as a substitute. Viewing and changing substitution records of other users requires the 'substitution' permission. The substitution permission path is as follows.
Admin Permissions/Manage/BPMN/Manage BPMN Substitutions |
See Managing Role Permissions for more information on adding permissions.
Adding and managing user substitution
This section guides you through adding, updating and viewing substitutions. You can do this using either the BPMN-explorer user interface or from the substitution APIs.