Instead of:
when("R".equalsIgnoreCase(simple("${body.filing.frstatus}").toString()))

you should have something like:
when(simple("${body.filing.frstatus} == 'R')")

or implement your own predicate. It's only an interface with one method:
http://camel.apache.org/predicate.html
when(MyFrStatusCheckingPredicate("R"))

Best,
Christian

On Tue, Mar 12, 2013 at 3:39 PM, irshad <[email protected]> wrote:

> Hello,
>
> I am pretty new in using camel and trying to incorporate it in our
> architecture, so everyone here is pretty new to Camel.
>
> Question:  After the choice() method we are using a boolean expression in
> when() where it is complaining to use predicate. So could you give an idea
> how to use predicate for the same.
>
> from("direct:saveFile").convertBodyTo(List.class).split(body())
>                         .choice()
>
> .when("R".equalsIgnoreCase(simple("${body.filing.frstatus}").toString()))
>                                         .to("sql:insertQuery")
>
> .when("R".equalsIgnoreCase(simple("${body.filing.frstatus}").toString()))
>                                         .to("sql:updateQuery")
>                         .otherwise()
>                                 .to("errorHandler")
>                         .end();
>
>
> thanks
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-use-predicate-in-when-for-Body-in-choice-tp5728999.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>

Reply via email to