3 Replies Latest reply on Mar 19, 2007 2:52 PM by kukeltje

    using a JBPM timer

    pwfarwell

      I need to create a workflow where a node will stay in a wait state until either a timer "times out" or the user completes the task -- whichever comes first. What's the best way to model this use case?

      I think I understand how to assign and complete tasks. But I'm not too sure about timers. (I am still getting my JBoss deployment working with the jbpm scheduler, so I can't test the scenarios yet).

      Here's a simplified version of the task-node with a timer (and without any user assignments yet):

       <task-node name="MyWaitNode">
       <task>
       <timer duedate="05/04/2007">
       <action class="com.acme.MyActionHandler" /action>
       </timer>
       </task>
       <transition name="Next Step" to="Next Step" />
       </task-node>
      


      A couple of questions:
      1) If the timer "times out" by the duedate and the user didn't complete the task, will the workflow automatically transition to the next node, "Next Step"? Or do I need to signal to transition in the ActionHandler associated with the timer?

      2) How do I make sure that MyActionHandler is *always* triggered - that is, regardless of whether the timer "timed out" or the user completed the task? Should I associate an action with the transition?

      3) Do timers (and the 'scheduler' service) required db persistence? My test workflow example isn't persistent (though in the future it probably will be). My understanding is that I only need to enable the 'scheduler' property in my jbpm.cfg.xml file and make sure that the JbpmThreadsServlet is configured correctly in my web app's web.xml file. Is that correct?

      Thanks in advance,

      pf


        • 1. Re: using a JBPM timer
          kukeltje

          1: look at the testcases in the source. Lots of info there
          2: yes, place an action on the transition or the 'leave node' event
          3: I'm not sure. best if you try. But even if it does, you could always use the in-memory hsqldb. No 'real' persistence then.

          • 2. Re: using a JBPM timer
            pwfarwell

             

            "kukeltje" wrote:
            1: look at the testcases in the source. Lots of info there
            2: yes, place an action on the transition or the 'leave node' event
            3: I'm not sure. best if you try. But even if it does, you could always use the in-memory hsqldb. No 'real' persistence then.


            Thanks!

            This is probably a dumb question, but where are the testcases you are referring to? Does JBPM ship with its own JUnit tests? If so, where are they located?

            Also, just a clarification about persistence. I'm asking whether the Timer (and scheduler service) require the JBPM db tables (as defined by Hibernate mapping files). In my case, I trying to avoid using Oracle or HSQL dbs.

            • 3. Re: using a JBPM timer
              kukeltje

              in cvs.. there is no -src.tgz distribution or something like that