This section guides you through user substitution and how to work with it in the WSO2 Business Process Server.
User substitution involves defining a substitute for a particular user for a given time window. This is particularly useful in BPMN user tasks when the original task assignee becomes unavailable, for instance, 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 with time period that they are going to be unavailable. Once this specified period (substitution period) is started, all the existing task of the user are transferred to the substitute (Bulk reassignment). From this point onwards, any task that are going to be assigned to the user will be assigned to the substitute user. To the existing tasks that particular assignee is a candidate user, the substitute also will be added as a candidate user. If you enabled the transitivity (explained in configuration section) and if the given substitute is not available (ie: he also in vacation), the engine will try to find a transitive substitute by going through available substitution records. In this way the engine use the best available user as the substitute. But if the system could not find a proper substitute (a cyclic dependency between substitutions), it will return an error, rejecting the substitution request. But this rejection is possible only for the substitutions that are starting just after the substitute request. For a scheduled substitution, if the engine end up with not having 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. We have provided REST APIs to add, update and lookup substitution information. Also, there is a separate tab in BPMNexplorer where you can experience all the facilities provided by substitution APIs.
Enabling user substitution
activity.xml file found in the
<BPS_HOME>/repository/conf/ directory and uncomment or add in the following configuration.
|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.|
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.
Working with substitution
This section guides you through adding, updating and viewing substitutions. You can do this using either the BPMN-explorer user interface or using the substitution APIs.