use of io.camunda.zeebe.engine.processing.deployment.model.element.ExecutableSequenceFlow in project zeebe by camunda.
the class SequenceFlowTransformer method transform.
@Override
public void transform(final SequenceFlow element, final TransformContext context) {
final ExecutableProcess process = context.getCurrentProcess();
final ExecutableSequenceFlow sequenceFlow = process.getElementById(element.getId(), ExecutableSequenceFlow.class);
parseCondition(element, sequenceFlow, context.getExpressionLanguage());
connectWithFlowNodes(element, process, sequenceFlow);
}
use of io.camunda.zeebe.engine.processing.deployment.model.element.ExecutableSequenceFlow in project zeebe by camunda.
the class ExclusiveGatewayTransformer method transformDefaultFlow.
private void transformDefaultFlow(final ExclusiveGateway element, final ExecutableProcess process, final ExecutableExclusiveGateway gateway) {
final SequenceFlow defaultFlowElement = element.getDefault();
if (defaultFlowElement != null) {
final String defaultFlowId = defaultFlowElement.getId();
final ExecutableSequenceFlow defaultFlow = process.getElementById(defaultFlowId, ExecutableSequenceFlow.class);
gateway.setDefaultFlow(defaultFlow);
}
}
use of io.camunda.zeebe.engine.processing.deployment.model.element.ExecutableSequenceFlow in project zeebe by camunda-cloud.
the class SequenceFlowTransformer method transform.
@Override
public void transform(final SequenceFlow element, final TransformContext context) {
final ExecutableProcess process = context.getCurrentProcess();
final ExecutableSequenceFlow sequenceFlow = process.getElementById(element.getId(), ExecutableSequenceFlow.class);
parseCondition(element, sequenceFlow, context.getExpressionLanguage());
connectWithFlowNodes(element, process, sequenceFlow);
}
use of io.camunda.zeebe.engine.processing.deployment.model.element.ExecutableSequenceFlow in project zeebe by camunda-cloud.
the class ExclusiveGatewayProcessor method findSequenceFlowToTake.
private Either<Failure, Optional<ExecutableSequenceFlow>> findSequenceFlowToTake(final ExecutableExclusiveGateway element, final BpmnElementContext context) {
if (element.getOutgoing().isEmpty()) {
// there are no flows to take: the gateway is an implicit end for the flow scope
return Either.right(Optional.empty());
}
if (element.getOutgoing().size() == 1 && element.getOutgoing().get(0).getCondition() == null) {
// only one flow without a condition, can just be taken
return Either.right(Optional.of(element.getOutgoing().get(0)));
}
for (final ExecutableSequenceFlow sequenceFlow : element.getOutgoingWithCondition()) {
final Expression condition = sequenceFlow.getCondition();
final Either<Failure, Boolean> isFulfilledOrFailure = expressionBehavior.evaluateBooleanExpression(condition, context.getElementInstanceKey());
if (isFulfilledOrFailure.isLeft()) {
return Either.left(isFulfilledOrFailure.getLeft());
} else if (isFulfilledOrFailure.get()) {
// the condition is fulfilled
return Either.right(Optional.of(sequenceFlow));
}
}
// no condition is fulfilled - try to take the default flow
if (element.getDefaultFlow() != null) {
return Either.right(Optional.of(element.getDefaultFlow()));
}
return Either.left(new Failure(NO_OUTGOING_FLOW_CHOSEN_ERROR, ErrorType.CONDITION_ERROR, context.getElementInstanceKey()));
}
use of io.camunda.zeebe.engine.processing.deployment.model.element.ExecutableSequenceFlow in project zeebe by zeebe-io.
the class SequenceFlowTransformer method transform.
@Override
public void transform(final SequenceFlow element, final TransformContext context) {
final ExecutableProcess process = context.getCurrentProcess();
final ExecutableSequenceFlow sequenceFlow = process.getElementById(element.getId(), ExecutableSequenceFlow.class);
parseCondition(element, sequenceFlow, context.getExpressionLanguage());
connectWithFlowNodes(element, process, sequenceFlow);
}
Aggregations