use of io.camunda.zeebe.engine.processing.deployment.model.element.ExecutableFlowElementContainer in project zeebe by camunda.
the class SubProcessProcessor method onActivate.
@Override
public void onActivate(final ExecutableFlowElementContainer element, final BpmnElementContext activating) {
variableMappingBehavior.applyInputMappings(activating, element).flatMap(ok -> eventSubscriptionBehavior.subscribeToEvents(element, activating)).ifRightOrLeft(ok -> {
final var activated = stateTransitionBehavior.transitionToActivated(activating);
final ExecutableStartEvent startEvent = element.getNoneStartEvent();
if (startEvent == null) {
throw new BpmnProcessingException(activated, NO_NONE_START_EVENT_ERROR_MSG);
}
stateTransitionBehavior.activateChildInstance(activated, startEvent);
}, failure -> incidentBehavior.createIncident(failure, activating));
}
use of io.camunda.zeebe.engine.processing.deployment.model.element.ExecutableFlowElementContainer in project zeebe by zeebe-io.
the class SubProcessTransformer method transformEventSubprocess.
private void transformEventSubprocess(final SubProcess element, final ExecutableProcess currentProcess, final ExecutableFlowElementContainer subprocess) {
// set the element type explicitly because the element name is equal to an embedded subprocess
subprocess.setElementType(BpmnElementType.EVENT_SUB_PROCESS);
if (element.getScope() instanceof FlowNode) {
final FlowNode scope = (FlowNode) element.getScope();
final ExecutableFlowElementContainer parentSubProc = currentProcess.getElementById(scope.getId(), ExecutableFlowElementContainer.class);
parentSubProc.attach(subprocess);
} else {
// top-level start event
currentProcess.attach(subprocess);
}
final ExecutableStartEvent startEvent = subprocess.getStartEvents().iterator().next();
startEvent.setEventSubProcess(subprocess.getId());
}
use of io.camunda.zeebe.engine.processing.deployment.model.element.ExecutableFlowElementContainer in project zeebe by camunda-cloud.
the class SubProcessTransformer method transformEventSubprocess.
private void transformEventSubprocess(final SubProcess element, final ExecutableProcess currentProcess, final ExecutableFlowElementContainer subprocess) {
// set the element type explicitly because the element name is equal to an embedded subprocess
subprocess.setElementType(BpmnElementType.EVENT_SUB_PROCESS);
if (element.getScope() instanceof FlowNode) {
final FlowNode scope = (FlowNode) element.getScope();
final ExecutableFlowElementContainer parentSubProc = currentProcess.getElementById(scope.getId(), ExecutableFlowElementContainer.class);
parentSubProc.attach(subprocess);
} else {
// top-level start event
currentProcess.attach(subprocess);
}
final ExecutableStartEvent startEvent = subprocess.getStartEvents().iterator().next();
startEvent.setEventSubProcess(subprocess.getId());
}
use of io.camunda.zeebe.engine.processing.deployment.model.element.ExecutableFlowElementContainer in project zeebe by zeebe-io.
the class StartEventTransformer method transform.
@Override
public void transform(final StartEvent element, final TransformContext context) {
final ExecutableProcess process = context.getCurrentProcess();
final ExecutableStartEvent startEvent = process.getElementById(element.getId(), ExecutableStartEvent.class);
startEvent.setInterrupting(element.isInterrupting());
if (element.getScope() instanceof FlowNode) {
final FlowNode scope = (FlowNode) element.getScope();
final ExecutableFlowElementContainer subprocess = process.getElementById(scope.getId(), ExecutableFlowElementContainer.class);
subprocess.addStartEvent(startEvent);
} else {
// top-level start event
process.addStartEvent(startEvent);
}
if (startEvent.isMessage() && element.getScope() instanceof Process) {
evaluateMessageNameExpression(startEvent, context);
}
}
use of io.camunda.zeebe.engine.processing.deployment.model.element.ExecutableFlowElementContainer in project zeebe by zeebe-io.
the class SubProcessTransformer method transform.
@Override
public void transform(final SubProcess element, final TransformContext context) {
final ExecutableProcess currentProcess = context.getCurrentProcess();
final ExecutableFlowElementContainer subprocess = currentProcess.getElementById(element.getId(), ExecutableFlowElementContainer.class);
if (element.triggeredByEvent()) {
transformEventSubprocess(element, currentProcess, subprocess);
}
}
Aggregations