-
1. Re: How to setup Event to stop current execution & "jump" to that node?
melc Oct 19, 2011 3:56 AM (in response to rrpeterson)1 of 1 people found this helpfulHi,
You can simply add some variables to the process (unless you have some facts in your knowledge session that you can access within the process) and initialise them according to the state you are in, then use exclusive gateways by checking their values and act accordingly.
For example in your case add a boolean variable to your process i.e. emailWorkDone, with initial value false. Then if the 2nd path is started and completed based on your business logic then you can make the variable true and by adding a gateway between each timer and sendemail you can decide whether to send another email, by checking the variable, or go to the human task or something else....
-
2. Re: How to setup Event to stop current execution & "jump" to that node?
swiderski.maciej Oct 19, 2011 8:30 AM (in response to rrpeterson)1 of 1 people found this helpfulHi,
have you thought about using sub process and interrupting catch event? I mean that you could create sub process that will enclose timer, send email activities in a loop with a condition to execute the loop for maximum three times (or whatever is your requirement) and then attach to the sub process an interrupting boundary event (signal for instance) that will stop the sub process and continue alternative path.
HTH
-
3. Re: How to setup Event to stop current execution & "jump" to that node?
melc Oct 19, 2011 5:05 PM (in response to swiderski.maciej)Hello,
Maciej what you describe sounds really interesting! I know i might be asking too much but i would greatly appreciate if you could provide a rough/draft bpmn of what you describe. Also i wonder whether it is possible to design such bpmn on any of the designers.... anyhow it would be great if you could show such a bpmn. Thanks
-
4. Re: How to setup Event to stop current execution & "jump" to that node?
swiderski.maciej Oct 20, 2011 7:04 AM (in response to melc)Chris, sure thing I will try ot create such process as soon as I wil be back from my business trio because I do not have my development environment. Hopefully by the end of the weekend.
I think that Eclipse BPMN2 plugin (the new one) is capable of creating such process but I would give a try to web designer as well.
-
5. Re: How to setup Event to stop current execution & "jump" to that node?
rrpeterson Oct 20, 2011 11:17 AM (in response to rrpeterson)Thanks guys,
Maciej: I tried using a sub-process for the email sections (email sections would always be comprised of emails & timers, but I wasn't able to get the event to interrupt the process flow in the sub-process. (It'd keep sending emails & waiting). I tried using some of the examples as a guide (BPMN2-EscalationBoundaryEvent.bpmn2 for example), but I wasn't able to get it working properly.
Chris: Do you have any examples of this? I'm still a little weak in my understanding of processInstance variables, I'm not sure what the right way to implement a solution like this might be.
My (somewhat crude) solution was to make an event based diverging gateway that links to a copy of each event for each timer (since the timer is waiting for the event to happen). Then all events converge and move through that path of execution. This way if the event happens then the process goes that way, if the timer expires before the event, then the original path is taken. It feels rather in-elegant, but it does seem to work properly in my testing.
User Task is the action to take if an event never happens, Script is the action to take if one of the events happens:
-
6. Re: How to setup Event to stop current execution & "jump" to that node?
melc Oct 24, 2011 5:55 AM (in response to rrpeterson)Hello,
If i have understood correctly your case, please take a look at the attached bpmn for a possible approach. It is not a fully working example.... just showing the concept.
So the idea is,
1. you send email to some user to do some job
2. you start the timer, to give time to the user to do the job before sending next email
3. you check if the user has done the job. This check is done by checking if the process variable jobDone has been set to true
4. if it is set, in other words if the job is done, then go down to the process for running script and ending the process
5. if the job is not done then send another email and wait for some time
6. check again if the job has been done ....
7. if not do the human task and end the process
-
testWithEmails.bpmn.zip 1.8 KB
-
-
7. Re: How to setup Event to stop current execution & "jump" to that node?
swiderski.maciej Oct 23, 2011 1:32 PM (in response to melc)Finally found some time to take a try with what I described, so the process would look something like this (it does not address all the requirements but just illustrates how it could be used):
Process was drawn in BPMN2 eclipse plugin so most of it was possible but few elements, like timer duration, need to be done directly on xml.
I have managed to run the example and it was interupting the sub process when signalled so it seems like it could be rather nice alternative to more complex options given above.
Unfortunately signal event is not implemented for boundary events, small modification to jBPM code is required.
Please find attached complete bpmn definition for reference.
-
subprocess.bpmn2.zip 1.6 KB
-
-
8. Re: How to setup Event to stop current execution & "jump" to that node?
melc Oct 24, 2011 6:39 AM (in response to swiderski.maciej)Thanks Maciej this looks nice and efficient.
I would also like to add that based on this and the approach i proposed earlier, in order to support arbitrary number of email sendings, the following could be done, which works on eclipse editor and jbpm with no modifications.
The same as before just using an embedded sub process and introduced two more process variables, loopIterations and loopCount.
-
testWithEmails2.bpmn.zip 2.1 KB
-
-
9. Re: How to setup Event to stop current execution & "jump" to that node?
rrpeterson Oct 24, 2011 11:04 AM (in response to melc)Thanks guys for all the feedback, especially the excellent examples.
I'm going to try out a blending of both approaches, similar to Chris' Oct 24th post.
One last question for Maciej: You mentioned signal event isn't implemented for boundary events, did you use the signalEventDefinition in your example just to illustrate how it would look once JBPM (assuming it will) implements a signal event for boundary events?
Thanks again for all the info!
-
10. Re: How to setup Event to stop current execution & "jump" to that node?
swiderski.maciej Oct 24, 2011 11:58 AM (in response to rrpeterson)I made required modification to jBPM code base to try it out, just to verify the outcome if it. Of course it does not mean that I covered all cases.
Good luck with your implementation.
-
11. Re: How to setup Event to stop current execution & "jump" to that node?
rrpeterson Oct 24, 2011 12:54 PM (in response to swiderski.maciej)Appreciate it! Wish I could mark multiple correct answers.