It’s a process, which calls a embedded subprocess. This subprocess contains three call activites, which calls the same subprocess, only the input variable for the category is different.
In “Get Category”, a Java Delegate is called to get the evaluate the category (passed as input variable) if it needs to be approved or not. If not, the task ended successully. If the category needs to be approved, a user task is created. Depending on the decision, the subprocess ended normaly (approved) or the task shoud emit an event (in case of not approved).
The final result should be, that if one of the three subtasks (from the call activities) emits an event, all other user tasks will be canceled and the “final token” runs to the “Modify Data” user task.
I tried different way (end tasks with message, intermediate / boundary event), but it didn’t worked.
I also tried three different subproceses (three times the same content - only the process names were different and the message name that was emitted), but no success.
I hope someone can help me, how to design such a workflow.
thank you very much for your sample. Now I found my “problem”. In the message end event I entered the same value for Global Message referenced like in my main process. I thought this will be enough for sending the event. The process got the information that this is a message end event, it has got the name of the event - but no message was send.
But in your example I saw, that I have to implement a function call to send the event. After I added this code, the message was sent and received and everything works fine.