Monday, March 23, 2015

JBoss BPM Suite Quick Guide: Automating User Task Reassignments

You have a process project completed successfully, with several user tasks that need to be assigned to a role so that some group in your organization can process them in a timely fashion.

The project launches into testing phases, passes with flying colors and heads into production.

Then a problem surfaces that was not accounted for in your requirements and did not surface during project testing.

Some of the members of a group that processes the user tasks assigned to them are taking too long to complete their claimed tasks.

After some initial investigations you discover that the BPM process is working just fine, the user tasks are being setup in task lists for the group assigned during development.

Task claimed from group, but not being completed
while user on sick leave...
A closer look unearths that the problem is in the users, not the BPM project.

The problem

Users get sick, take time off and basically can become suddenly unavailable for a variety of reasons.

All of these might be valid reasons, but it means for the process that it has to wait until the task claimed by the unavailable user to be released or completed upon their (hopefully) eventual return to work.

The solution

The best way to deal with this problem you decide is to be able to put a timer on any claimed task so that if the deadline to complete the task is missed, it will be dropped back into the group for another user to process.

There is a task feature in JBoss BPM Suite that allows you to set a reassignment for any task and it is very easy to use from the  process designer.

For this article we reference an HR Employee Rewards project that can be built in the JBoss BPM online workshop.*
Automate approve reward task reassignment.

After lab 17 in the workshop, we have a completed process project as described above, with a user task that has caused our company problems due to unforeseen user behavior.

Within the process designer we can edit the Approve Reward task by clicking on it, opening the right side panel to view the user task properties.

Scroll down the task properties and you will find Reassignment field, which you open to view the Reassignment Editor. Here you can add a reassignment and enter the details around our user ERICS and manager group to set a time limit for tasks that get claimed by this user but are not  completed within one minute.

Adding reassignment for user erics and manager group.
Fill in the following reassignment fields:

  • Users:  erics
  • Groups: manager
  • Expires At: 1m
  • Type: not-completed
Note you can set the time to be seconds (s), minutes (m), days (d) or weeks (w) as needed but to make it testable in our demo we choose to set this to one minute (1m).

Close this editor by clicking on the OK button and save the process.

Task claimed into personal list and out of the group.

The results

Now you need to open the Project Editor, build & deploy the project and you can test your automated reassignment.

Testing is achieved by starting a process, submitting a reward, claiming the task waiting for a manager in the task list and waiting one minute to see if it is automatically reassigned back to the group.
After one minute, the task is reassigned to the group
and no longer in the personal list!

It worked, right?

If not, you can try it step-by-step online in our workshop, lab18 shows you how to do it from scratch.

[*In this article we will use the HR Employee Rewards demo project as a baseline, which you can also build from scratch by following the JBoss BPM Suite online workshop. If you obtain this project, follow the install instructions you will find a completed solution of what is described here.]