1 Reply Latest reply on Nov 23, 2005 11:01 AM by jeb

    Help with Timers

    jeb

      I am trying to implement a behaviour in jbpm where a failed operation is retried a number of times with some delay between retries.

      I am using the 3.1.alpha.

      the problem seems to arise in the Timer for the delay which I specified like this:

      <state name="wait2minutes">
       <transition name="timeElapsed" to="doOperation"/>
       <timer name='retryDelay'
       duedate='2 minutes'
       transition='timeElapsed' >
       </timer>
       </state>]


      when I create the task from the webapp the timer and the transition is executed once, so the operation gets executed again. If this attempt fails again the process gets stuck in "wait2minutes" forever, no timer entry is created in "jbpm_timers"

      When I create such a processinstance programmatically (running inside jboss) the process gets stuck there on the first attempt.

       ProcessDefinition processDefinition =
       jbpmSession
       .getGraphSession()
       .findLatestProcessDefinition("testProcess");
       ProcessInstance processInstance =
       new ProcessInstance(processDefinition);
      
       Token token = processInstance.getRootToken();
       assertEquals("start", token.getNode().getName());
       token.signal();
      
       jbpmSession.commitTransaction();
       jbpmSession.close();
      


      what am I doing wrong here? Any hints appreciated...



        • 1. Re: Help with Timers
          jeb


          ahh, the second problem was apparently caused by not doing a
          graphSession.saveProcessInstance(processInstance)
          before the commit...

          just my first problem unsolved then...