Subprocess + parallel gateway exists from subprocess leads to unexpected parallel execution behaviour

Hi there. I’m using Flowable 7.0.0 with the UI Modeler and I have a question regarding parallel executions inside a subprocess.

:pushpin: Current process structure

I have a chain of subprocesses:

SubP1 β†’ SubP2 β†’ SubP3 β†’ ...

Inside SubP1, the structure looks like:

  • A service task

  • A parallel gateway

  • Several branches that wait on different intermediate signal catch events

  • An exclusive gateway that decides whether to:

    • move forward to the next subprocess, or

    • rerun SubP1

  • A Terminate End Event inside the subprocess

:magnifying_glass_tilted_left: The problem

When I trigger one of the signal events in SubP1, the token reaches the Terminate End Event, the subprocess exits, and execution reaches the exclusive gateway in the parent process.

However, I observe an unexpected behavior:

Two executions continue in parallel:
β€’ One follows the intended rerun path
β€’ The other continues forward to the next subprocess

It appears that other tokens from the parallel gateway are not being terminated, and they escape the subprocess.


:red_question_mark:Question

How can I ensure that when a specific signal is triggered:

:check_mark: Only one execution remains active
:check_mark: The subprocess restarts cleanly (or exits cleanly)
:multiply: No parallel tokens continue to run or escape into the parent process

Is there a Flowable-approved design pattern to reliably terminate all parallel tokens inside a subprocess without stopping the entire process instance?


Thank you in advance for any guidance! :folded_hands:

Hey @Yevheniio,

Can you please share your BPMN XML for this?

I just tried with a process like:

When I completed Task 3 the sub process goes to β€œAfter Sub Process”, even when Task 1 and Task 2 are still not completed.

Cheers,
Filip

Hello @filiphr , thanks for such a quick reply.
Sub2

So, if you look at this closely, it does not look beauty, sorry :slight_smile: , but when i call signal with variables which should rerun the sub2 it actually reruns it but also in parallel moves forward to sub3, and when the rerun process is finished i can still rerun and have the same behaviour, so it works , but unexpected with this moving forward in parallel to sub3

I will add root process in next reply

@filiphr this is root

Thanks for sharing the images.

Looking at your root model this is not unexpected. Your Sub2, actually has 2 outgoing flows, when it finishes, regardless of how it will take each one, you can think of it like having a parallel flow just before those 2 flows.

I believe that if you remove one of the flows, the one going directly from Sub2 to Sub3 then it will behave as you are expecting it to.

Cheers,
Filip

I see what you mean, let me try. Thank you