When the process reaches the countersigning node, parameters need to be set in advance. This parameter was passed to us by another system, so we need to know when we need to pass it. So, may I ask if Camunda has an API to obtain the parameters required for the next node:
Currently, the next node is obtained by traversing the bpmnModel, but problems can arise when faced with complex bpm //Obtain the next node information and fill in the corresponding parameters getmap(xxxx); taskService.setVariablesLocal(Task, map); taskService.complete(Task, map);
Thanks for explaining your use case. Unfortunately, there is no way to find out the next activity in a BPMN process reliably. As you stated, for rather trivial cases, it might be possible to parse the model and derive the next node, but using non trivial models, this will fail ... there could be an intermediate message receiver involved, an error handler, a loop, a condition ... you have to rely on the engine executing your model.
To solve your particular problem (without digging deeper) it might be an option to initialize the signer list variable with an empty value before entering the multi-instance task, or make the whole embedded subprocess multi instance an use a condition (on the loop or using a conditional interrupting boundary event) to stop when the signers have been set. But this would require more discussion and is maybe better suited for the forum than SO.