Handling message event

Hi Team,
I would like to start a sub process (Task-5) once Task-2 & Task-4 (both tasks) completed.

How can I do that ? Can someone help me on this ?

Your process has an implicit parallel split after Task-1, and another one after Task-2
It would be clearer to model these explicitly.

Once you know that you have parallel splits, it becomes clear that you can use parallel join.

So you can connect Task-2 and Task-4 to the parallel join, and the workflow will wait at the parallel join until both tasks have been completed.

Next… A subprocess cannot start by message, from the standard, it is only allowed to start with the empty start.

A Message is NOT EXPECTED to work within a process. They are designed for communicating BETWEEN processes.

So… What is the expected flow from Task-2 supposed to be?

I’m guessing that you want to remove both the Intermediate Message Throw and the End event after Task-2, and then connect Task-2 to a parallel join. Connect Task-4 to the same parallel join. Then connect the parallel join to the subprocess. Fix the start on the subprocess to a basic start, and you should be good to go.

1 Like

Hi @GotnOGuts ,
In Realtime Task-2 is belongs to different sub flow & Task-4 is belongs to different sub flow. So I cannot use gateways between that. Any other ways can we do that without using gateways ?

Please explain what you mean by “sub flow”

The only way to really model “Wait here until both of < these > things happen” is with a parallel join.
You could consider using conditions to model it, but that gets really obfuscated and hard for someone else to maintain.

This workflow is actually functionally the same as the prior workflow, but way harder to read. If you need the “Send Message” after Task-2, you could use an intermediary message throw instead of a End Message Throw.

Based on what you posted as your simplified model, these are really the best way to handle it.

Hi @GotnOGuts ,
Thanks for your response.
Here I attached the exact expectation to explain you more detail.
Task-8 (Billing Sub process) should start once all of the Task-6 (Purchase Sub process) & Task-4 should be completed.

Task-6 + Task-4 → Then Task-8 should start

I just tried to via message event. but looks that is difficult. Can you please provide your suggestions ?
Need to do without Service Task

The “Inclusive Join” is the wrong join type to use here… It’s used for when you have an unknown number of tokens floating around.

Since you have multiple Task-4 calls, when should it be continued?
Should it only happen when all the Task-4 are completed? If that’s the case, then Task-7 needs to operate on the same collection as the Purchase Sub-Process but is not really part of the same sub-process. I think you’re potentially suffering from cardinality issues. Remember that each process (or subprocess) needs to operate on the same number of items (eg. 1 Purchase Request → Many Subprocess for Items on Purchase Request, but multiple Billing Requests associated with the Purchase Request because they operate at a different granuality or cardinality)

If you try to put too many things into one process, you’ll find that it doesn’t work well.

You cannot send a message after Task-4 for “Billing Subprocess” to catch because they are both in the same parent process.

Also, I’d still STRONGLY recommend that you model your parallel joins explicitly, as that is much easier to read and understand.

Okay. Thanks a lot @GotnOGuts . will try as you suggested.

Since you have multiple Task-4 calls, when should it be continued?