Search in sources :

Example 1 with SplitStepHandler

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();
}
Also used : ConnectorDescriptor(io.syndesis.common.model.action.ConnectorDescriptor) ConnectorAction(io.syndesis.common.model.action.ConnectorAction) Step(io.syndesis.common.model.integration.Step) Split(io.syndesis.common.model.Split) SplitStepHandler(io.syndesis.integration.runtime.handlers.SplitStepHandler)

Aggregations

Split (io.syndesis.common.model.Split)1 ConnectorAction (io.syndesis.common.model.action.ConnectorAction)1 ConnectorDescriptor (io.syndesis.common.model.action.ConnectorDescriptor)1 Step (io.syndesis.common.model.integration.Step)1 SplitStepHandler (io.syndesis.integration.runtime.handlers.SplitStepHandler)1