[jboss-user] [jBPM] - Re: jBPM Timer usage

saig0 do-not-reply at jboss.com
Thu Sep 6 08:56:28 EDT 2012


saig0 [https://community.jboss.org/people/saig0] created the discussion

"Re: jBPM Timer usage"

To view the discussion, visit: https://community.jboss.org/message/758317#758317

--------------------------------------------------------------
Hi leaf-xue!

Here is the process with embedded timers. The inner timer fires every 1 second. The boundary timer fires after 5 seconds and end the process. 

 https://community.jboss.org/servlet/JiveServlet/showImage/2-758317-19430/TimerProcess.png  https://community.jboss.org/servlet/JiveServlet/downloadImage/2-758317-19430/450-264/TimerProcess.png 

   <process processType="Private" isExecutable="true" id="TimerProcess" name="TimerProcess" tns:packageName="defaultPackage" tns:version="1" >
  
    <!-- nodes -->
    <startEvent id="_1" name="StartProcess" />
    <subProcess id="_2" name="Sub-Process"  >
    <!-- nodes -->
    <startEvent id="_2-1" name="Start" />
    <intermediateCatchEvent id="_2-2" name="Timer" >
      <timerEventDefinition>
        <timeCycle xsi:type="tFormalExpression">0s###1s</timeCycle>
      </timerEventDefinition>
    </intermediateCatchEvent>
    <scriptTask id="_2-3" name="Action" scriptFormat="http://www.java.com/java" >
      <script>System.out.println("Action!");</script>
    </scriptTask>
    <endEvent id="_2-4" name="End" />
    <!-- connections -->
    <sequenceFlow id="_2-1-_2-2" sourceRef="_2-1" targetRef="_2-2" />
    <sequenceFlow id="_2-2-_2-3" sourceRef="_2-2" targetRef="_2-3" />
    <sequenceFlow id="_2-3-_2-4" sourceRef="_2-3" targetRef="_2-4" />
    </subProcess>
    <scriptTask id="_3" name="Timeout" scriptFormat="http://www.java.com/java" >
      <script>System.out.println("Timeout!");</script>
    </scriptTask>
    <endEvent id="_4" name="End" >
        <terminateEventDefinition/>
    </endEvent>
    <boundaryEvent id="_5" name="Timeout" attachedToRef="_2" >
      <timerEventDefinition>
        <timeDuration xsi:type="tFormalExpression">5s</timeDuration>
      </timerEventDefinition>
    </boundaryEvent>
  
    <!-- connections -->
    <sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" />
    <sequenceFlow id="_5-_3" sourceRef="_5" targetRef="_3" />
    <sequenceFlow id="_3-_4" sourceRef="_3" targetRef="_4" />
  
  </process>
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://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/20120906/c68f2a9c/attachment-0001.html 


More information about the jboss-user mailing list