[jboss-user] [jBPM] - [jBPM 4.3] Cancel Job/Timer

Melih Cetin do-not-reply at jboss.com
Wed May 26 06:30:46 EDT 2010


Melih Cetin [http://community.jboss.org/people/kafsinkaf] replied to the discussion

"[jBPM 4.3] Cancel Job/Timer"

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

--------------------------------------------------------------
Hi HuiSheng,

The simplified process definition is:

<process name="TimerTest" xmlns=" http://jbpm.org/4.3/jpdl http://jbpm.org/4.3/jpdl">
   <start g="185,63,48,48" name="start">
      <transition g="-44,-18" name="to task1" to="task1"/>
   </start>
   <task g="162,161,92,52" name="task1" candidate-groups="sales-support">
      <transition g="-43,-18" name="to state" to="state"/>
   </task>
   <state g="162,232,92,52" name="state">
      <on event="timeout">
      <timer duedate="1 minute" repeat="1 minute"/>
         <event-listener class="mytest.TimerTest">
            <property name="successTransition">
               <string value="toTask"/>
            </property> 
         </event-listener>
      </on>
      <transition g="-44,-18" name="toTask" to="task"/>
   </state>
   <task g="162,320,92,52" name="task" candidate-groups="sales-support">
      <transition g="-42,-18" name="to end1" to="end"/>
   </task>
   <end g="183,410,48,48" name="end"/>
</process>

and the simplified event handler where we signal the execution is:

public class TimerTest implements EventListener {
    static int cnt = 0;
    private String successTransition;
    
    public String getSuccessTransition() {
        return successTransition;
    }

    public void setSuccessTransition(String successTransition) {
        this.successTransition = successTransition;
    }

    public void notify(EventListenerExecution execution) throws Exception {
        cnt++;
        if (cnt > 2) {
            progress(execution);
        }
    }

    public void progress(EventListenerExecution prmEventListenerExecution) {
        org.jbpm.api.Configuration.getProcessEngine().getExecutionService().signalExecutionById(prmEventListenerExecution.getId(), successTransition);
    }
}

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

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

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/20100526/c9254785/attachment-0001.html 


More information about the jboss-user mailing list