cancel
Showing results for 
Search instead for 
Did you mean: 

Asynchronous Tasks Continuation

richip
Champ in-the-making
Champ in-the-making
I've a very simple requirement that it seems almost textbook case, but I can't seem to find it in the examples that I've found over Google or using the search function of the forums (perhaps I'm using the wrong term? "asynchronous")

Basically, I've a process that requires an execution of a remote service from my engine but it's asynchronous in nature. Meaning, the expected response will come back through a later session (in this case through a queue). I can handle the message transport no problem, but 1) I don't know what components in the BPMN diagram to use to model this and 2) obviously depending on which components I use, what methods to invoke in the RuntimeService to invoke to continue the process from where it stopped.

If there a cookbook of examples somewhere?
3 REPLIES 3

richip
Champ in-the-making
Champ in-the-making
Figured it out. The only way this seems to work for me is if I use a ServiceTask (with the Asynchronous flag set) with a sequenceFlow to a MessageStartEvent (with the message configured on the Process). I tried a whole slew of others (including having an EventSubProcess and a SubProcess with various start events) and this is the only combination that seems to work. Not sure if it's the right one, though.

jbarrez
Star Contributor
Star Contributor
The way this is typically handled is either
- use a combination of a service task that sends out a message and a receive task afterwards. The message coming back will have to use the executionId to correlate
- use a custom ActivityBehaviour (NOT JavaDelegate) that does the sending + waiting for the message in one step (similar to previous, but visually in one step)

govin_pillay
Champ in-the-making
Champ in-the-making

Hi jbaeeez,

could you perhaps give an example of implementing the above.

Thanks.