1 Reply Latest reply on Sep 16, 2011 11:42 AM by rrpeterson

    Adding a timer between Service tasks causes ProcessInstance.getStatus() to be STATE_ACTIVE after completion


      Hey guys,


      I've got two identical custom service tasks setup to be called one after another in my .bpmn file.  Each task does its job, and when complete calls workItemManager.completeWorkItem 


      With just a start -> serviceTask -> serviceTask -> end, defined, both get called twice, and retrieving the session status at the completion of the tasks results in STATE_COMPLETED as expected.


      Adding a timer as:  start -> serviceTask -> timer(5 seconds, 0 period) -> serviceTask -> end, both get called twice, but after retrieving the session status at the completion of the tasks results in STATE_ACTIVE.  Shouldn't it be STATE_COMPLETED same as the other?  Examining the log output for the tasks in the database shows the same state status throughout both runs, each node being entered/exited, so it seems like they should both have the same status at completion.


      I also have trouble when starting with a timer, such as:
      start -> timer(5 seconds, 0 period) -> serviceTask -> end
      my serviceTask is never invoked after calling ksession.startProcess   I've tried inserting various Thread.sleep() in an effort to see if my serviceTask will be invoked, with no luck.  Is there something special that needs to happen once the timer is complete?  I don't seem to have any handle to the timer itself other than that it needs to begin using ksession.startProcess



      Any advice/suggestions would be appreciated!