1 Reply Latest reply on Jun 19, 2012 5:17 PM by Bira Neto

    JBPM Timers behaviour

    Bira Neto Newbie

      What is the bahaviour for jbpm timers in a low level? Does reaching the end event in the workflow clears the timers?

      I also ask this because I have a workflow that has a start timer (with a cycle type and 1 min period) leading to an end event. I was expecting it to start every minute but it only do so while the end event is not reached (if I put some more flows and gateways that block the end from being reached). Is that expected behaviour or should timers fire indefinetely for such a workflow?

        • 1. Re: JBPM Timers behaviour
          Bira Neto Newbie

          Adding some more info on the subject. It appears the problem happens with persistence enabled only. Is this a bug? Should I code something else when using persistence for timers to work properly?

           

          I'm using version 5.3.

          The workflow is an start event with timer event definition with a cycle of 1 second... going to a script system out hello world and then to an end event.

           

          Executing with JPA.... loading ksession with JPAKnowledgeService.loadStatefulKnowledgeSession( sessionId, kbase, null, env ).startProcess("testTimer");

           

          The execution is shown below

          163745 [http-8080-1] WARN bitronix.tm.twopc.Preparer - executing transaction with 0 enlisted resource

          Hibernate: select nextval ('hibernate_sequence')

          Hello World

          Hibernate: select processins0_.InstanceId as col_0_0_ from ProcessInstanceInfo processins0_ inner join EventTypes eventtypes1_ on processins0_.InstanceId=eventtypes1_.InstanceId where eventtypes1_.eventTypes=?

          Hibernate: update SessionInfo set lastModificationDate=?, rulesByteArray=?, startDate=?, OPTLOCK=? where id=? and OPTLOCK=?

          Hibernate: insert into ProcessInstanceInfo (id, lastModificationDate, lastReadDate, processId, processInstanceByteArray, startDate, state, OPTLOCK, InstanceId) values (?, ?, ?, ?, ?, ?, ?, ?, ?)

          Hibernate: delete from ProcessInstanceInfo where InstanceId=? and OPTLOCK=?

           

          Executing with a simple stateful session... Loading ksession with kbase.newStatefulKnowledgeSession().startProcess("testTimer");

           

          Hello World

          Hello World

          Hello World

          Hello World

          Hello World

          Hello World

          Hello World

          Hello World

          Hello World

          Hello World

          Hello World

          (forever untill I cancel execution)