Using RuntimeService::startProcessInstanceByMessage


I have some questions about the Messages in the Flowable engine. My questions are more like from a theoretical point of view rather than technical :slight_smile:
So, here is my case:

I want to have a process instance with one service task. This service task will start another process instance using the method RuntimeService::startProcessInstanceByMessage. The other process instance has a MessageStartEvent and it is waiting for a message to be received in order the process instance to be started. So far, so good, but I want the process instance with the service task to be suspended when I execute the RuntimeService::startProcessInstanceByMessage and after the second process finishes work, to return back to the suspended process instance and to continue.
I see that this is not an easy task using the Java API, as the new process is started and the old one is continuing working. I have managed to do that using a boundary event but my problem is that the boundary event is over flooding my diagram.
So, do you have some preposition here for me? I would like to hear some options if there are any.

Thanks a lot,

Hey Encho,

Have you thought about using a Call Activity. The Call Activity is there for exactly the reason you specified. The process that will create the call activity will block until the Call Activity finished. That is all handled by the engine and you won’t need to do anything.