You can use simple, mvel, ognl, groovy as the language to build that predicate
http://camel.apache.org/languages

For example with simple

when(simple("${body.isErrors().size()} < 1"))



On Tue, Oct 18, 2016 at 3:53 PM, spurcell <scott_purc...@mastercard.com> wrote:
> Hello Team,
>
> I have a Pojo in my exchange, and the pojo has a List<Errors> that may be
> empty or may have 0..* errors. I would like to create a .choice() based upon
> the size of the errors list. Is this possible? I see that I can use header
> and body in the choice, but not sure if the pojo will work. Can someone
> chime in on this?
>
> Thanks
>
> Something like this:
>  .choice()
>                 .when(body().isErrors().size() < 1))
>                 .to("bean:xxx"")
>                 .otherwise()
>                 .to("bean:xxx");
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Choice-Based-On-Pojo-in-Exchange-tp5788899.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to