1 Reply Latest reply on Apr 6, 2011 11:13 AM by Kris Verlaenen

    What happens if the TaskServer is shutdown between Created and Complete states?

    bpmn2user Expert

      There was discussion (

      http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-5-1-0-M1-Human-Task-How-to-get-the-WorkItem-change-state-after-restart-of-MinaTaskServer-td62057.html

      ) about a scenario where Taskserver is shutdown before reaching the Completed state.

       

      what if the Minaservice has to be stopped in between (taskhas been created but not yet reached the completed status) – then we lose all the registeredevents (as these are not persistent events) in the following thread.

      – now when we restart theMina service we query the task – and let’s say we changed the statethrough “Reservedà InProgressàCompleted”.  Now since the registered events are lost, how doesthe work item will be marked as “completed” (as the associated WSHTtask has completed) so that the drools process can move forward –basically end in this case?

       

       

      There was a JIRA created for this issue https://jira.jboss.org/jira/browse/JBRULES-2002.

       

      I am wondering if the fix has made it to JBPM5.0.

       

      Kris or Mauricio: Any comments are appreciated

        • 1. What happens if the TaskServer is shutdown between Created and Complete states?
          Kris Verlaenen Master

          The engine registers itself to the task service when you initialize your WSHumanTaskHandler.  Assume you need to recreated your session and task service (for example due to failure), the state of your process instances and of your human tasks are persisted in the session and task service respectively.  So you can restore them from database.  When reconnecting the session to the task service, the listener will also be restored.

           

          There used to be an issue where there was one listener for each requested task.  The fix as applied in JBRules-2002 now uses a generic listener for all tasks.  This is also how it works in jBPM 5.0.

           

          Note that the task handler usually only lazily connects to the task service (so the first time the session tries to create a task).  To make sure you connect immediately (so you can retrieve task completion events even before the first task is created), do handler.connect() after registering it.  This will instantiate the listener.

           

          Kris