During task execution, if the task is determined to be serial or parallel.
looking forward to your reply
wisdom
During task execution, if the task is determined to be serial or parallel.
looking forward to your reply
wisdom
Are you looking for how to set multi-instance tasks in the Camunda Modeler?
@wisdom During runtime to determine the multi instance activity is parallel or sequential can be retrieved from multi instance loop characteristic of that activity.
<bpmn:userTask id="Activity_0nx1m8l" name="Assign Role" camunda:asyncAfter="true" camunda:assignee="demo">
<bpmn:extensionElements>
<camunda:executionListener delegateExpression="${multiInstanceExecutionListener}" event="start" />
</bpmn:extensionElements>
<bpmn:incoming>Flow_18xcz6f</bpmn:incoming>
<bpmn:outgoing>Flow_1604omz</bpmn:outgoing>
<bpmn:multiInstanceLoopCharacteristics isSequential="true" camunda:collection="${X}" camunda:elementVariable="y" />
</bpmn:userTask>
Adding below Execution listener to the start event will tell you whether multi instance is sequential or parallel.
@Slf4j
@Component
public class MultiInstanceExecutionListener implements ExecutionListener {
@Override
public void notify(DelegateExecution execution) throws Exception {
boolean isMultiInstanceTask = ((ExecutionEntity) execution).getActivity().isMultiInstance();
if (isMultiInstanceTask) {
UserTaskActivityBehavior activityBehavior = (UserTaskActivityBehavior) ((ExecutionEntity) execution)
.getActivity().getActivityBehavior();
UserTask userTask = (UserTask) execution.getBpmnModelElementInstance();
MultiInstanceLoopCharacteristics multiInstanceLoopCharacteristics = (MultiInstanceLoopCharacteristics) userTask
.getLoopCharacteristics();
String multiInstanceType = multiInstanceLoopCharacteristics.isSequential() ? "Sequential" : "Parallel";
log.info("{} is multi instance activity? {} of type {} execution",
activityBehavior.getTaskDefinition().getNameExpression(), isMultiInstanceTask, multiInstanceType);
}
}
}
Thank you for your pointers.The problem has been solved
thanks
I want to do the fetch in code, the problem has been solved in the next reply.
thank you for your reply