[jboss-user] [jBPM] - Timer in jBPM,

Syed Mahdi do-not-reply at jboss.com
Tue Mar 1 02:39:06 EST 2011

Syed Mahdi [http://community.jboss.org/people/armahdi] created the discussion

"Timer in jBPM,"

To view the discussion, visit: http://community.jboss.org/message/590244#590244

hi All,

I am trying to create and incorporate a timer in my jBPM process definition I have found some examples but they dont really state what they exactly were doing:

Like what is the difference between (Impl 1): 

>  <task-node name="step1" end-tasks="true">
>  <event type="node-enter">
>  <create-timer name="myTimeout" duedate="1 minute" transition="toExpire">
>  <action name="testWriteOut" expression="#{timerLogger.logTimer}"/>
>  </create-timer>
>  </event>
>  <task name="taskA" description="task 1">
>  <assignment actor-id="userA" />
>  </task>
>  <transition name="finished" to="end"/>
>  <transition name="toExpire" to="expire"/>
>  </task-node>

And this (Impl 2):

> <task-node name="timerTest">
>  <task name="taskA" description="TimerTestTask">
>  <assignment actor-id="userA" />
>   <timer duedate="1 minute" transition="finished">
>  <action expression="#{timerTestWorkflow.logTimerFired}" />
>  </timer>
>  </task>
>  <transition name="finished" to="end" />
>  </task-node>

what is the basic difference between the two implementation. If i wanted a timer that will be executed after the task has ended which one is best for my use case. My use case is like this... UserA is assigned  taskA and when he finishes, the jBPM waits for 1 hour and then assigns TaskB it to User B who can actually end the process. 

Other way of seeing it is like UserA is assigned TaskA and when he finishes the taskA the token goes to task B and assigns it to UserB and waits there for 1 hour and notifies the UserB that timer is expired so he can end it. Or do you think I shud make a state for the timer it self like (Impl 3):

> <state name="timerstate">
>  <timer name="wait one minute" duedate="1 minute" transition="toTaskB"> 
>  </timer>
>  <transition to="taskB" name="toTaskB"></transition>
> </state>
 and then transfer to tasknode B where taskB is assigned to userB.  but then it wont be assigned to any user in this state so it will not show up in the pooled task either. 

in impl 1 above if after 1 minute it tranistions to "toExpire" then how does the task in the task node gets executed
in Impl2 does the timer gets fired after 1 minute or instantly when it reaches the tasknode and if within a minute the userA does not do anything it finishes??? does it mean that userA will be assigned the task for 1 minute only... Is there a possibility then to fire an action after the 1 miute as well. ?? 

off topic: why arent there that many good examples for the timer. 


Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110301/a3b461e7/attachment-0001.html 

More information about the jboss-user mailing list