Problems triggering Subprocess with MessageEndEvent

Hi all,

we’ve got a BPMN-Model which need to be terminated on several conditions.

In the following model, I indicate this behaviour on two aspects only, but needed on others too:

In all of this cases, the process must do some work before it could be terminated. Therefor I tried to model an embedded subprocess with message-triggers:

The red message-end events throw a message called “erwCancelInvoice” and the blue message-start event in subprocess is catching this message.

If I test the new model, the subprocess is never startet. Seems that the message-throwing/-catching not working in this szenario. I think there is something wrong within my model?

Thanks in advance for your help,
Thomas

Hi Thomas,
sending the message inside one process is a little problematic, it is not recommended and it is a little tricky to do. Can you please post your code for the message correlation that is used at the message end event?
Do you see any errors in the log?

Thanks for your reply.

It’s the first time I try modelling with messages … there is no explicit implementation for the message correlation (thought this is done automatically, cause the message to throw is configured in the modeller).

Do I always need an explicit implementation?

Cheers
Thomas

PS: Cause of your feedback about message-sending in the same process I now try another way and will post it here for discussion.

Still thinking about the process, I created another model using message-boundary.
It’s not finished yet, just published to get some hints/feedback from you :slight_smile:

Is this way to handle with message in same process a better way to solve my problem?

Thanks, Thomas

Hi @webert,

I wouldn’t model this situation with a message event (because you are actually not sending messages). You just want to check at several points if a condition is true, and if this is the case you want to start a subprocess.

So I would suggest you use a conditional event instead of a message event. You can read about it here.

This events represents your use case a bit better.
So set a condition as a process variable in your subprocess if you want to trigger the subprocess or not and add a conditional boundary event to the subprocess.

Hope this helps.

Regards
Michael

1 Like

Hi Michael,

thanks for your reply. I read about the conditional events in your link (and old school) in my BPMN-Book from Thomas Allweyer :slight_smile:

At this, I found the cancel-boundary event - which sounds like it fits to my requirements, cause I must cancel the subprocess and after doing that, I must cancel the parent-process.

I’l give it a try and will publish a new model here.

Regards
Thomas

Update: Just found the note: “Only a single cancel boundary event is allowed for a transaction subprocess.” - :fearful:

Hello together,

after “studying” the BPMN-documentations, I found an interesting way with transactions and compensations … this sounds like the solution for me.

Can you please take a look at the following model - is this valid with the transaction-cancel and then stop the hole process after sub-process has done it’s compensations?

Rergards, Thomas