use of io.camunda.zeebe.engine.processing.deployment.model.transformation.TransformContext in project zeebe by camunda.
the class MultiInstanceActivityTransformer method transformLoopCharacteristics.
private ExecutableLoopCharacteristics transformLoopCharacteristics(final TransformContext context, final MultiInstanceLoopCharacteristics elementLoopCharacteristics) {
final boolean isSequential = elementLoopCharacteristics.isSequential();
final Optional<Expression> completionCondition = Optional.ofNullable(elementLoopCharacteristics.getCompletionCondition()).map(CompletionCondition::getTextContent).filter(e -> !e.isEmpty()).map(context.getExpressionLanguage()::parseExpression);
final ZeebeLoopCharacteristics zeebeLoopCharacteristics = elementLoopCharacteristics.getSingleExtensionElement(ZeebeLoopCharacteristics.class);
final Expression inputCollection = context.getExpressionLanguage().parseExpression(zeebeLoopCharacteristics.getInputCollection());
final Optional<DirectBuffer> inputElement = Optional.ofNullable(zeebeLoopCharacteristics.getInputElement()).filter(e -> !e.isEmpty()).map(BufferUtil::wrapString);
final Optional<DirectBuffer> outputCollection = Optional.ofNullable(zeebeLoopCharacteristics.getOutputCollection()).filter(e -> !e.isEmpty()).map(BufferUtil::wrapString);
final Optional<Expression> outputElement = Optional.ofNullable(zeebeLoopCharacteristics.getOutputElement()).filter(e -> !e.isEmpty()).map(e -> context.getExpressionLanguage().parseExpression(e));
return new ExecutableLoopCharacteristics(isSequential, completionCondition, inputCollection, inputElement, outputCollection, outputElement);
}
use of io.camunda.zeebe.engine.processing.deployment.model.transformation.TransformContext in project zeebe by camunda-cloud.
the class MultiInstanceActivityTransformer method transformLoopCharacteristics.
private ExecutableLoopCharacteristics transformLoopCharacteristics(final TransformContext context, final MultiInstanceLoopCharacteristics elementLoopCharacteristics) {
final boolean isSequential = elementLoopCharacteristics.isSequential();
final Optional<Expression> completionCondition = Optional.ofNullable(elementLoopCharacteristics.getCompletionCondition()).map(CompletionCondition::getTextContent).filter(e -> !e.isEmpty()).map(context.getExpressionLanguage()::parseExpression);
final ZeebeLoopCharacteristics zeebeLoopCharacteristics = elementLoopCharacteristics.getSingleExtensionElement(ZeebeLoopCharacteristics.class);
final Expression inputCollection = context.getExpressionLanguage().parseExpression(zeebeLoopCharacteristics.getInputCollection());
final Optional<DirectBuffer> inputElement = Optional.ofNullable(zeebeLoopCharacteristics.getInputElement()).filter(e -> !e.isEmpty()).map(BufferUtil::wrapString);
final Optional<DirectBuffer> outputCollection = Optional.ofNullable(zeebeLoopCharacteristics.getOutputCollection()).filter(e -> !e.isEmpty()).map(BufferUtil::wrapString);
final Optional<Expression> outputElement = Optional.ofNullable(zeebeLoopCharacteristics.getOutputElement()).filter(e -> !e.isEmpty()).map(e -> context.getExpressionLanguage().parseExpression(e));
return new ExecutableLoopCharacteristics(isSequential, completionCondition, inputCollection, inputElement, outputCollection, outputElement);
}
use of io.camunda.zeebe.engine.processing.deployment.model.transformation.TransformContext in project zeebe by zeebe-io.
the class MultiInstanceActivityTransformer method transformLoopCharacteristics.
private ExecutableLoopCharacteristics transformLoopCharacteristics(final TransformContext context, final MultiInstanceLoopCharacteristics elementLoopCharacteristics) {
final boolean isSequential = elementLoopCharacteristics.isSequential();
final Optional<Expression> completionCondition = Optional.ofNullable(elementLoopCharacteristics.getCompletionCondition()).map(CompletionCondition::getTextContent).filter(e -> !e.isEmpty()).map(context.getExpressionLanguage()::parseExpression);
final ZeebeLoopCharacteristics zeebeLoopCharacteristics = elementLoopCharacteristics.getSingleExtensionElement(ZeebeLoopCharacteristics.class);
final Expression inputCollection = context.getExpressionLanguage().parseExpression(zeebeLoopCharacteristics.getInputCollection());
final Optional<DirectBuffer> inputElement = Optional.ofNullable(zeebeLoopCharacteristics.getInputElement()).filter(e -> !e.isEmpty()).map(BufferUtil::wrapString);
final Optional<DirectBuffer> outputCollection = Optional.ofNullable(zeebeLoopCharacteristics.getOutputCollection()).filter(e -> !e.isEmpty()).map(BufferUtil::wrapString);
final Optional<Expression> outputElement = Optional.ofNullable(zeebeLoopCharacteristics.getOutputElement()).filter(e -> !e.isEmpty()).map(e -> context.getExpressionLanguage().parseExpression(e));
return new ExecutableLoopCharacteristics(isSequential, completionCondition, inputCollection, inputElement, outputCollection, outputElement);
}
Aggregations