Stop and Restart sub-process from parent

Hello everyone,

I have a parent model whose job is mainly to call sub-processes.

I am using a parallel gateway to start all sub-processes at the same time and only complete the parent process when they are all done.

My requirements are that I need to be able to stop and restart one subprocess.

  • Stopping a process instance shouldn’t block the parent process from continuing.
  • It should be possible to restart a sub process without restarting the parent process.
  • Only after the sub-process has started do I know whether it isn’t necessary anymore.

At the moment, if we delete a process instance, the token will be lost and the parent process stuck.
An alternative could be to implement a boundary even on the sub-process level.

But I don’t know how I could restart the sub process within the same parent.

Thank you for your thoughts on how to handle this problem!

I am wondering if the real relationship between these processes are indeed Parent/sub-processes given the described level of independece between their life-cycles.

Hi @Jadwiga,

You can model it as below (Notice: boundary message is used to stop call activity instance including the called process)

This can be easily done by starting the sub-process directly as a separate process.

This is already implemented in the 1st point.

Kindly find attached a simplified working example
test-sub-process-b.bpmn (2.2 KB)
test-sub-process-a.bpmn (2.2 KB)
call-multiple-processes.bpmn (7.9 KB)

If you mean to restart a sub-process from within the main process while it is active then event sub-process can be used

Hi @victorhugof,
this is a good point. The main reason why I need to group those processes is that they need to start with the same Message start Event and I noticed that it’s not possible to have multiple processes with the same message start event.

Thank you @hassang for your reply and examples!
I tried this solution but my problem is to start the sub-process within the parent process again.

  1. Parent process starts
  2. One sub process is interrupted by a boundary event.
  3. I want to start this sub process again and use POST /process-definition/key/{key}/start
  4. The sub process is started without the previous Super Process Instance ID, the process is running as a standalone and I lose the relation to the parent.

Am I using the wrong request?

Hi @Jadwiga,

Okay… if you need to keep the relation to the main process then you can implement restart operation as non-interrupting event sub-process (according to your posted process, you need to have three event sub-processes each with a unique start message) or you can have a single event sub-process in which bpmn element to be called is defined as expression.

I am going to post an example later.

Hi @Jadwiga,

Kindly find attached an example main process with non-interrupting event sub-process to restart sub-processes dynamically.
call-multiple-processes.bpmn (10.0 KB)

You can restart sub-process “test-sub-process-a” as follow

1 Like

Thank you @hassang for the time you dedicated in your answers. I will try out your ideas and let you know if it works!

1 Like