[jboss-user] [jBPM] - Issue with transitioning a task from an attached timer

Mukul Tandon do-not-reply at jboss.com
Mon Aug 23 17:18:34 EDT 2010


Mukul Tandon [http://community.jboss.org/people/mukult] created the discussion

"Issue with transitioning a task from an attached timer"

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

--------------------------------------------------------------
In jbpm 4.2, I am not able to transition a task out from a repeating timer which becomes active when the task is created. I want to monitor some external condition in that timer and when it is met, I want to complete the task because its no more needed. When I'm signalling the transition the task still remains active and the timer.notify() gets fired again after the current notify() is done.
I must not be using the timer or signalling the task correctly. Can anybody provide any input?
Thanks in advance.

Here's the code




<? xml version=+"1.0" encoding=+"UTF-8"?>

++<process description=+"Timer Test Process" key=+"tt" name=+"TimerTest" xmlns=+"http://jbpm.org/4.0/jpdl">
<start g=+"328,116,48,48">  <transition g=+"-122,-18" to=+"Followup"/>  </start>
<task g=+"284,230,169,52" name=+"Followup"> <on event="timeout" name="TimerEvent"> <timer duedate="10 minutes" repeat="1 minutes"/>  <event-listener class="com.ubs.octane.workflow.bo.process.TestEventListener"/>  </on>  <transition g="-42,-18" name="Complete" to="Review"/> </task>   <task g="288,330,169,52" name="Review">  <transition g="-42,-18" name="Acknowledge" to="end"/>  <transition g="468,301:-70,8" name="Reject" to="Followup"/> </task>   <end g="345,432,48,48" name="end"/></process>   public class TestEventListener implements EventListener { protected int countCalled =0;   public void notify(EventListenerExecution execution) throws Exception {  countCalled++;  if(countCalled>=2){ //Will check some external condition here         Application appInstance = Application.getApplicationInstance(UBSConstants.APPLICATION_NAME);         ProcessEngine pe= (ProcessEngine)appInstance.getStaticData(WorkflowConstants.JBPM_PROCESS_ENGINE_INSTANCE);         ExecutionService es =pe.getExecutionService();         //This is not working         es.signalExecutionById(execution.getId());             System.out.println("Done");   } }}                                                                                                                                                                                                                                                                                                                                      +++++++++++++
++

++
+
++++
++


+++++++++
++
+
++++
++
+++++++++++
++
+
++++
++

++++++++
+
++++
++

++++++++++
++++
++

++
++
++
++




--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/558649#558649]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

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


More information about the jboss-user mailing list