-
-
2. Re: jBPM Timer usage
leaf-xue Sep 6, 2012 4:05 AM (in response to saig0)I also encountered this problem, you can tell me in detail under the two timers are configured attribute this?
-
3. Re: jBPM Timer usage
saig0 Sep 6, 2012 8:56 AM (in response to leaf-xue)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.
<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>
-
TimerProcess.bpmn.zip 1.2 KB
-
-
4. Re: jBPM Timer usage
leaf-xue Sep 6, 2012 10:28 PM (in response to saig0)Hi saig0!
Thank you very much for your reply, is very helpful for me!
If I want to do a similar timing task flow, for example: a process inside a task over two hours and did not finish, then I will use email to remind the user.May I ask timer node can complete it? How to do it? Oh, add a bit, you know "0s###1s" is to follow a rule?What about his rule is?
-
5. Re: jBPM Timer usage
saig0 Sep 7, 2012 2:54 AM (in response to leaf-xue)The following code is the configuration of the time event in jBPM. The expression "0s###1s" include the delay (0s) and the period (1s) of the timer.
<timerEventDefinition> <timeCycle xsi:type="tFormalExpression">0s###1s</timeCycle> </timerEventDefinition>
You can configure a boundary timer events if it should terminate the attached process or not then it fire. Just set the attribute "cancelActivity" on boundary event. So you can use it to build a remember function with a not terminating boundary timer event. Note that a boundary event can only attached to a process and not to a single activity.
<boundaryEvent id="_5" name="Timeout" attachedToRef="_2" cancelActivity="false" > <timerEventDefinition> <timeDuration xsi:type="tFormalExpression">5s</timeDuration> </timerEventDefinition> </boundaryEvent>
-
-
7. Re: jBPM Timer usage
saig0 Sep 7, 2012 3:29 AM (in response to leaf-xue)I used the jbpm eclipse plugin to create the process and can't attached the event on a single activity. Do you use guvnor? Does it run with jbpm? Which version of jbpm do you use?
I think your process isn't correct if you just want to remember the user. If you use a termination end event "end3" the whole process instance will end.
-
8. Re: jBPM Timer usage
leaf-xue Sep 7, 2012 3:45 AM (in response to saig0)You are right, this process does not correct, I was in the designer2.2 draw flow chart.
-
9. Re: jBPM Timer usage
koorio Oct 8, 2012 11:49 AM (in response to saig0)Hello guys, I really need some help here
I still can't understand how to set up timer events, like: what to write in the properties, where to put the .xml file and if it needs to be named like the .bpmn file, and how to make the timer or the signal event be part of the task (like leaf-xue made for user2 task with a timer).Please, really can't figure it out by myself, I've searched on google but found nothing useful for this situation!
Thanks all,
regards
Leo