use of io.syndesis.integration.runtime.handlers.SplitStepHandler in project syndesis by syndesisio.
the class IntegrationRouteBuilder method handleConnectorSplit.
private Optional<ProcessorDefinition> handleConnectorSplit(Step step, ProcessorDefinition route, String index) {
if (step.getAction().filter(ConnectorAction.class::isInstance).isPresent()) {
final ConnectorAction action = step.getAction().filter(ConnectorAction.class::isInstance).map(ConnectorAction.class::cast).get();
final ConnectorDescriptor descriptor = action.getDescriptor();
if (descriptor.getSplit().isPresent()) {
final Split split = descriptor.getSplit().get();
final Step.Builder splitBuilder = new Step.Builder().stepKind(StepKind.split);
split.getLanguage().ifPresent(s -> splitBuilder.putConfiguredProperty("language", s));
split.getExpression().ifPresent(s -> splitBuilder.putConfiguredProperty("expression", s));
return new SplitStepHandler().handle(splitBuilder.build(), route, this, index);
}
}
return Optional.empty();
}
Aggregations