7 Replies Latest reply on Jul 28, 2013 5:45 AM by crasybpm

    Human task escalation understanding


      Hi community,


      I have some questions about Human Task node in jbpm v5.4. Actually I am designing a sample process that contains two human tasks ,in the second one I had defined Escalation mechanism ( when task is not-started , set expires at to 60s and set user Id).

      When process reaches the second node of my process I see that after 60s , that Task status ( in jbpm database  table Task) changed from "Reserved" to "Ready", but no user is assigned on that task (actualOwner_id had been changed to NULL) . I was wondering what could be the cause of that ?


      I tried to see the java API but I did not find how I can catch the escalation event for Human Task , May I have any idea or help about how I can do that ? because actually what I am trying to do is when "Human Task" had been reassigned to another user , I should call a Java method to update some data  on my application.



        • 1. Re: Human task escalation understanding

          this is according to WS-HT specification that says that task should be set to Ready state after reassignment. As that allows to be claimed by all potential owners defined. See WS-HT spec section 4.9.



          1 of 1 people found this helpful
          • 2. Re: Human task escalation understanding

            Hi Maciej

            thanks for the quick reply and for the help.

            Actually I saw WS-HT specification, it says that after reassignment the task status changes from Reserved to ready and so the task could be claimed by on of the declared as potentiel owners or groups.But the limitation is when task is reassigned ,the only way to notify for that change is to send an e-mail.

            In fact ,I would like to know if there any way to call a custom java service or method when the task is reassigned ( status changes from reserved to ready).that why I am asking if it is possible to catch the event that is responsible for changing task status after timeout.



            • 3. Re: Human task escalation understanding

              Hi all,


              Is there any help on my previous question.


              Thanks in advance.

              • 4. Re: Human task escalation understanding

                It seems you will need to hack your own solution. The class in charge of deadlines and escalation is: https://github.com/droolsjbpm/jbpm/blob/master/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/task/service/DefaultEscalatedDeadlineHandler.java

                Starting from line 187 is where the escalation logic takes place.

                It would be good to have a pluggable mechanism to add custom logic here. Something similar to WIHandlers, but for the HT server.


                Best Regards,

                • 5. Re: Human task escalation understanding

                  Good news is that it seems the pluggable mechanism is already there: https://github.com/droolsjbpm/jbpm/blob/master/jbpm-human-task/jbpm-human-task-war/src/main/java/org/jbpm/task/servlet/HumanTaskServiceServlet.java

                  You could implement your own solution using the code of DefaultEscalatedDeadlineHandler and adapt it to your needs.


                  Best Regards,

                  • 6. Re: Human task escalation understanding

                    Hi Esteban,


                    Thanks a lot for your reply.


                    It is definitely provides me the solution how to customize escalation event . Actually here is the solution I set up according to what you explained before , it is working fine  and  I am giving the java code that can help other members  to define quickly a customized escalation.

                    Just for information , I do not  use the Servlet HumanTaskServiceServlet  in my application as mechanism for plugging cutomized task service.


                    Actually I am using spring configuration on my application , so at startup I am creating the task service using the code below :


                    public void initialize(){


                    MyOwnEscalationHandler Myhandler = new MyOwnEscalationHandler();

                    taskService = new TaskService(emf, SystemEventListenerFactory.getSystemEventListener(),Myhandler);// register my handler in the task service


                    The class MyOwnEscalationHandler is the following


                    public class MyOwnEscalationHandler implements

                    EscalatedDeadlineHandler {



                           public void executeEscalatedDeadline(Task task, Deadline deadline,

                    Content content, TaskService service) {

                    // TODO Auto-generated method stub

                    if ( deadline == null || deadline.getEscalations() == null) {

                    System.out.println("**********No escalation detected**********");




                    for ( Escalation escalation : deadline.getEscalations() ) {

                    System.out.println("Deadline detected  processing action ");

                    System.out.println("The task has expired , I am executing my own Deadline handler**********");

                    // we won't impl constraints for now



                    // run reassignment first to allow notification to be send to new potential owners

                    if ( !escalation.getReassignments().isEmpty()) {

                    // get first and ignore the rest.

                    Reassignment reassignment = escalation.getReassignments().get( 0 );


                                    task.getTaskData().setStatus( Status.Ready );

                    List potentialOwners = new ArrayList( reassignment.getPotentialOwners() );

                    task.getPeopleAssignments().setPotentialOwners( potentialOwners );

                    task.getTaskData().setActualOwner(new User("Administrator"));



                                for ( Notification notification : escalation.getNotifications() ) {

                    System.out.println("****** Notify by emaill**********");



                    deadline.setEscalated( true );




                    Best regards,

                    • 7. Re: Human task escalation understanding

                      Hello,         Thanks a lot for your post and code snippest. i used this into my example its working but its failed to remove task from dashboard who escalated it. My requirment is         1) User1 is assigned task with name task1 and if its not completed within 60s it will reassigment to user2.          I have implement you code in my example and code is esaclating but same time it is appearing in user1 dashboard as well as user2 dashboard.      please help thanks in advance.   Regards, crasybpm