use of io.camunda.zeebe.model.bpmn.instance.LoopCharacteristics in project zeebe by zeebe-io.
the class MultiInstanceActivityTransformer method transform.
@Override
public void transform(final Activity element, final TransformContext context) {
final ExecutableProcess process = context.getCurrentProcess();
final ExecutableActivity innerActivity = process.getElementById(element.getId(), ExecutableActivity.class);
final LoopCharacteristics loopCharacteristics = element.getLoopCharacteristics();
if (loopCharacteristics instanceof MultiInstanceLoopCharacteristics) {
final ExecutableLoopCharacteristics miLoopCharacteristics = transformLoopCharacteristics(context, (MultiInstanceLoopCharacteristics) loopCharacteristics);
final ExecutableMultiInstanceBody multiInstanceBody = new ExecutableMultiInstanceBody(element.getId(), miLoopCharacteristics, innerActivity);
multiInstanceBody.setElementType(BpmnElementType.MULTI_INSTANCE_BODY);
multiInstanceBody.setFlowScope(innerActivity.getFlowScope());
innerActivity.setFlowScope(multiInstanceBody);
// attach boundary events to the multi-instance body
innerActivity.getBoundaryEvents().forEach(multiInstanceBody::attach);
innerActivity.getEventSubprocesses().forEach(multiInstanceBody::attach);
innerActivity.getEvents().removeAll(innerActivity.getBoundaryEvents());
innerActivity.getEventSubprocesses().stream().map(ExecutableFlowElementContainer::getStartEvents).forEach(innerActivity.getEvents()::remove);
innerActivity.getInterruptingElementIds().clear();
// attach incoming and outgoing sequence flows to the multi-instance body
innerActivity.getIncoming().forEach(flow -> flow.setTarget(multiInstanceBody));
innerActivity.getOutgoing().forEach(flow -> flow.setSource(multiInstanceBody));
multiInstanceBody.getOutgoing().addAll(Collections.unmodifiableList(innerActivity.getOutgoing()));
innerActivity.getOutgoing().clear();
// replace the inner element with the body
process.addFlowElement(multiInstanceBody);
}
}
use of io.camunda.zeebe.model.bpmn.instance.LoopCharacteristics in project zeebe by camunda-cloud.
the class MultiInstanceActivityTransformer method transform.
@Override
public void transform(final Activity element, final TransformContext context) {
final ExecutableProcess process = context.getCurrentProcess();
final ExecutableActivity innerActivity = process.getElementById(element.getId(), ExecutableActivity.class);
final LoopCharacteristics loopCharacteristics = element.getLoopCharacteristics();
if (loopCharacteristics instanceof MultiInstanceLoopCharacteristics) {
final ExecutableLoopCharacteristics miLoopCharacteristics = transformLoopCharacteristics(context, (MultiInstanceLoopCharacteristics) loopCharacteristics);
final ExecutableMultiInstanceBody multiInstanceBody = new ExecutableMultiInstanceBody(element.getId(), miLoopCharacteristics, innerActivity);
multiInstanceBody.setElementType(BpmnElementType.MULTI_INSTANCE_BODY);
multiInstanceBody.setFlowScope(innerActivity.getFlowScope());
innerActivity.setFlowScope(multiInstanceBody);
// attach boundary events to the multi-instance body
innerActivity.getBoundaryEvents().forEach(multiInstanceBody::attach);
innerActivity.getEventSubprocesses().forEach(multiInstanceBody::attach);
innerActivity.getEvents().removeAll(innerActivity.getBoundaryEvents());
innerActivity.getEventSubprocesses().stream().map(ExecutableFlowElementContainer::getStartEvents).forEach(innerActivity.getEvents()::remove);
innerActivity.getInterruptingElementIds().clear();
// attach incoming and outgoing sequence flows to the multi-instance body
innerActivity.getIncoming().forEach(flow -> flow.setTarget(multiInstanceBody));
innerActivity.getOutgoing().forEach(flow -> flow.setSource(multiInstanceBody));
multiInstanceBody.getOutgoing().addAll(Collections.unmodifiableList(innerActivity.getOutgoing()));
innerActivity.getOutgoing().clear();
// replace the inner element with the body
process.addFlowElement(multiInstanceBody);
}
}
use of io.camunda.zeebe.model.bpmn.instance.LoopCharacteristics in project zeebe by camunda.
the class MultiInstanceActivityTransformer method transform.
@Override
public void transform(final Activity element, final TransformContext context) {
final ExecutableProcess process = context.getCurrentProcess();
final ExecutableActivity innerActivity = process.getElementById(element.getId(), ExecutableActivity.class);
final LoopCharacteristics loopCharacteristics = element.getLoopCharacteristics();
if (loopCharacteristics instanceof MultiInstanceLoopCharacteristics) {
final ExecutableLoopCharacteristics miLoopCharacteristics = transformLoopCharacteristics(context, (MultiInstanceLoopCharacteristics) loopCharacteristics);
final ExecutableMultiInstanceBody multiInstanceBody = new ExecutableMultiInstanceBody(element.getId(), miLoopCharacteristics, innerActivity);
multiInstanceBody.setElementType(BpmnElementType.MULTI_INSTANCE_BODY);
multiInstanceBody.setFlowScope(innerActivity.getFlowScope());
innerActivity.setFlowScope(multiInstanceBody);
// attach boundary events to the multi-instance body
innerActivity.getBoundaryEvents().forEach(multiInstanceBody::attach);
innerActivity.getEventSubprocesses().forEach(multiInstanceBody::attach);
innerActivity.getEvents().removeAll(innerActivity.getBoundaryEvents());
innerActivity.getEventSubprocesses().stream().map(ExecutableFlowElementContainer::getStartEvents).forEach(innerActivity.getEvents()::remove);
innerActivity.getInterruptingElementIds().clear();
// attach incoming and outgoing sequence flows to the multi-instance body
innerActivity.getIncoming().forEach(flow -> flow.setTarget(multiInstanceBody));
innerActivity.getOutgoing().forEach(flow -> flow.setSource(multiInstanceBody));
multiInstanceBody.getOutgoing().addAll(Collections.unmodifiableList(innerActivity.getOutgoing()));
innerActivity.getOutgoing().clear();
// replace the inner element with the body
process.addFlowElement(multiInstanceBody);
}
}
Aggregations