Hello my friend! I apologize if maybe I’m going too fast, but thanks for letting me know!
It’s basically what you said below, Camunda by default makes transactions in the database at each “breakpoint”, and the breakpoints are exactly where the instance is stopped waiting for some action to occur in the process.
However, this behavior can be modified using async before or async after.
Below is a link from Camunda itself explaining very well about the subject, I’m sure it will be a great knowledge to add.
As for your process, I see no reason to have a “message boundary event”.
I believe that the desired behavior in your subprocess, when it finishes you want it to exit your subprocess and start the service task “Read one row”, right?
If so, you can remove your boundary event, and connect it only with a sequence flow, because when your instance reaches the “End event”, it will go out through the sequence flow towards your service task, as I did in the example below :
The message correlate is for you, at some stage of your process, to be able to “warn” so that another stage starts through a message correlation…
For example in this process of yours, when your subprocess receives this message correlation, regardless of the stage it is in, it will exit the subprocess without finishing, because you sent a message to it saying: “I am ordering it to exit, and go to the service task NOW” hehehehe, almost like that.
That is, when you have subprocesses interconnected by sequence flows, you shouldn’t use message events.
I hope this helps!
William Robert Alves