camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From boday <ben.o...@initekconsulting.com>
Subject Re: RouteBuilder Predicate Syntax
Date Fri, 15 Jul 2011 20:28:12 GMT
#1 is correct, you should explicitly call end() after each choice() block...


enalposi wrote:
> 
> [Camel 2.7.2]
> 
> Sorry, but I am not quite clear about the syntax of inserting Predicates,
> esp to dynamically wire in processors... I am also not sure about the
> significance of end() and the newer endChoice(). Basically, doing 1 choice
> seems to be working but 2, as in below examples, breaks the continuation
> of the route "to".
> 
> I am trying to build something along the line of:
> - if predicate 'condition1' is true go through processor1 otherwise skip
> to the next
> - if predicate 'condition2' is true go through processor2 regardless of
> condition1
> - after evaluation of the predicates, join back into a common route
> definition segment.
> 
> Example:
> 
> from("in").
>     choice().when(condition1).process(processor1).end().
>     choice().when(condition2).process(processor2).end().
> to("to");
> 
> OR
> 
> 
> from("in").choice().
>     when(condition1).process(processor1).
>     when(condition2).process(processor2).
> end().to("to");
> 
> 
> Hope I was able to explain my issue :)
> 
> Thanks!
> 


-----
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: http://camel.465427.n5.nabble.com/RouteBuilder-Predicate-Syntax-tp4590722p4592073.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message