Java Code Examples for org.apache.camel.model.ProcessorDefinition#addOutput()
The following examples show how to use
org.apache.camel.model.ProcessorDefinition#addOutput() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StepParserSupport.java From camel-k-runtime with Apache License 2.0 | 6 votes |
public static ProcessorDefinition<?> convertSteps(ProcessorStepParser.Context context, ProcessorDefinition<?> parent, List<Step> steps) { ObjectHelper.notNull(context, "step context"); ObjectHelper.notNull(parent, "parent"); if (steps == null) { return parent; } ProcessorDefinition<?> current = parent; for (Step step : steps) { ProcessorDefinition<?> child = ProcessorStepParser.invoke( ProcessorStepParser.Context.of(context, current, step.node), step.id ); current.addOutput(child); if (child instanceof OutputNode && child.getOutputs().isEmpty()) { current = child; } } return parent; }
Example 2
Source File: DoTryStepParser.java From camel-k-runtime with Apache License 2.0 | 4 votes |
@Override public ProcessorDefinition<?> toProcessor(Context context) { DoTryDefinition definition = context.node(DoTryDefinition.class); ProcessorDefinition<?> processor = StepParserSupport.convertSteps( context, definition.delegate, definition.steps ); if (definition.doCatch != null) { StepParserSupport.convertSteps( context, definition.doCatch, definition.doCatch.steps ); CatchDefinition cd = new CatchDefinition(); cd.setExceptions(definition.doCatch.getExceptions()); cd.setOutputs(definition.doCatch.getOutputs()); // doCatch.when if (definition.doCatch.when != null) { StepParserSupport.convertSteps( context, cd.onWhen(definition.doCatch.when.getExpression()), definition.doCatch.when.steps ); cd.setOnWhen(definition.doCatch.when); } processor.addOutput(cd); } if (definition.doFinally != null) { StepParserSupport.convertSteps( context, definition.doFinally, definition.doFinally.steps ); FinallyDefinition fd = new FinallyDefinition(); fd.setOutputs(definition.doFinally.getOutputs()); processor.addOutput(fd); } return processor; }