@Override public Optional<ProcessorDefinition> handle(Filter step, ProcessorDefinition route, SyndesisRouteBuilder routeBuilder) { CamelContext context = routeBuilder.getContext(); Predicate predicate = JsonSimpleHelpers.getMandatorySimplePredicate(context, step, step.getExpression()); FilterDefinition filter = route.filter(predicate); routeBuilder.addSteps(filter, step.getSteps()); return Optional.empty(); }
@Override public ProcessorDefinition handle(Filter step, ProcessorDefinition route, SyndesisRouteBuilder routeBuilder) { CamelContext context = routeBuilder.getContext(); Predicate predicate = JsonSimpleHelpers.getMandatorySimplePredicate(context, step, step.getExpression()); FilterDefinition filter = route.filter(predicate); return routeBuilder.addSteps(filter, step.getSteps()); }
@Test public void testCanImport() throws Exception { assertCanAcceptInput(MarshalDefinition.class, false); assertCanAcceptInput(BeanDefinition.class, false); assertCanAcceptInput(FilterDefinition.class, true); }
public static FilterDefinition filter(ProcessorDefinition<?> self, Closure<?> predicate) { return self.filter(toExpression(predicate)); }
private ExpressionNode createFilterDefinition() { return new FilterDefinition(IN_OUT_CHECK) .processRef(VALIDATION.name()) .processRef(TRANSFORMATION.name()) .processRef(VALIDATION.name()); }