Hi, I have Operaton set up as a standalone application (using the Docker images) where Java applications execute tasks using the Java library org.operaton.bpm:operaton-external-task-client@2.0.0.
I am trying to introduce multi-instances (expanded sub processes) into the BPMN model, but have been unable to create variables in the multi-instance scope from the external tasks. How would I go about this? Ideally, the solution doesn’t require the external task implementation to know whether it is in multi-instance scope or not (because that seems to be a detail of the model, not the task)
I’ve been using a minimal BPMN model (see below). The script task creates a list of numbers (execution.setVariable("list", S("[1, 2, 3]"));). The multi-instance loops over this collection with element variable number. The first external task creates a copy of number called copy with the handler
(externalTask, externalTaskService) -> {
Map<String, Object> variables = externalTask.getAllVariables();
variables.put("copy", variables.get("number"));
externalTaskService.complete(externalTask, variables);
}
I’ve tried different versions of this, such as passing the copy variable in a localVariables map or by settings outputs in the BPMN model, but all result in a single copy variable on process instance level instead of a variable per multi-instance branch:
Any suggestions?


