JBoss Community

Re: Using a Timer

created by Gary tse in jBPM - View the full discussion

>>>

I would like to use a timer in my graph where after a given period of time the next node will be a service task call to do some work and complete the business process instance.

<<<

  • That can easily be done.  The tricky part is that the current designer UI does not allow you to attach a timer event to an "Embedded Sub-Process" so you have to manually edit the XML for that.

 

>>>

Is it true in order for the timer to work I need to reload the business process instance in memory and then call fireAllRules() on the statefulknowledgesession? 

<<<

  • No need.  The StatefulKnowledgeSession itself has a "timer thread" that kicks in when your schedule is due.

 

 

I would highly recommend you to take a look at the examples.  jbpm-examples/src/main/resources/junit/BPMN2-TimerBoundaryEventCycle1.bpm2  is exactly the kind of thing you want.

 

Good luck !

Reply to this message by going to Community

Start a new discussion in jBPM at Community