0

After starting from my MY_SUPER_PROCESS another subprocess using the following syntax:

 runtimeService.startProcessInstanceByKey('MY_SUBPROCESS_KEY') 

the subprocess is started and executed correctly, but in the admin panel flowable panel there is no subprocess visible for MY_SUPER_PROCESS. Also asking about 'MY_SUBPROCESS_KEY' instance returns that superProcessInstanceId is null.

Is there any possibility to start the subprocess so that the information about super process and subprocess connection won't be lost?

Łukasz Rzeszotarski
  • 5,791
  • 6
  • 37
  • 68

1 Answers1

2

Do you need to run the process via runtimeService? Try using callActivity.

UPD:

For start multi instance of subprocess in loop can use callActivity with Multi-instance marker.

  • I need to start a subprocess in a loop, while number of loops is undefined. So I need something like for (int i=0; i – Łukasz Rzeszotarski Mar 15 '21 at 20:54
  • 1
    Then maybe this [Multi-instance (for each)](https://flowable.com/open-source/docs/bpmn/ch07b-BPMN-Constructs/#multi-instance-for-each)? – Dmitriy Martyanov Mar 15 '21 at 22:55
  • this one looks good. you could update your answer then I would accept it. I need to check how to set variables for each loop and pass the number of loops, but this should be described in the documentation I guess. – Łukasz Rzeszotarski Mar 15 '21 at 23:02