I was wondering if it's possible to have a serviceTask (via code in the corresponding JavaDelegate) programmatically call one of the RuntimeService methods like:
messageEventReceived
OR
signalEventReceived
and have a boundary event on the same task catch this message (or signal).
From what I've tried this does not seem possible, as I get errors about a message listener not existing for the message that's thrown. So it seems like the boundary event gets setup after the javaDelegate executes?
I guess I'm a bit puzzled, because I'm able to get error boundary events to work (i.e. if a BpmnError is thrown, the boundary error event on the same task is able to handle it).
It would be awesome if I could do something like this:
http://camunda.org/share/#/process/68465d02-12cc-4cc2-aa3f-0e3dc5ace574
I know that I can set variables and insert a gateway after the service task to accomplish the same type of flows. I was just curious if the above scenario was possible.
Basically, I'm trying to achieve a pattern where a service task can end in:
1) Failure
2) Success (flow just continues on)
3) Event (a special event that dictates flow). **This is what I'm trying to achieve with my example above.
Any links/advice about best practices with regards to the end "Event" flow would be great as well.
Thanks,
Galen
I think you are right, and I'm leaning towards using outcome variables, and decision gates to model these kind of situations. In fact, that's currently how I have it modeled. I'm just thinking about other possible ways to do this, and weighing the pros and cons. Thanks for the input.
Galen