6 Replies Latest reply on Nov 10, 2011 7:27 AM by Sridhar J

    Persisting Human Task, letting user to complete after server restart.

    Adam Bach Novice

      I'm All!


      Here is my scenerio:

      1. Web Application

      2. User is not logged in.

      3. Some Process gets to the point where a user needs to perform some task like to call a client and make an appointment and than provide that data to the system so the process can go on.

      4. Server/application gets restarted.

      5. User loggs in and sees pending tasks to do.

      6. User calls client and makes appointment.

      7. User opens the form and provides appointment data. Submit

      8. Proces receives data and follows to the next task.


      From what I've read in user guide User/Human Tasks depand on UI or some WebService to "suspend" the task long enough for the user to finish taks but the user must finish his job before app gets closed. There is no persisting the state of tasn and restoring it when the user comes back later.


      Here is my dilema. Are Tasks a work units that must be executed and finished while program is running? Like that process must get to some save point like waiting for message/event before it can be persisted? Or mabe User/Human Task can be suspended, persisted, restored and than finished somewhere in the future??? How should I model that in bpmn2?

      Sth like that models saving to database info that user must fillin the form and waits for message from application:


      This isn't "good", I mean logicaly its correct but for me It should look more like:


      This one uses only one element for the whole operation of storing data,retrieving them when user loggsin and entering data to the process. But I cant find a way to implement this behavior using the JBPM5 API. WorkItem and WorkItemManager are provided from the system and they can't be persisted and retrieved later on.


      Please help as this is actualy the most important aspect of process construction for me.

      Thx to all


      PS: I can use JpaWorkItemManager to load WorkItem and ie complete it but I see no way to store it. Is it stored before entering executeWorkItem() method so I can store its id then finish this function without calling completeWorkItem() and in some future call getWorkItem() to get this work item back and complete it???


      How does this mechanism wotk?