Any particular reason why you are using 2.3 ?

On 24 August 2010 13:37, M.Ismail <[email protected]> wrote:

>
> Hi,
>
> I'm using Camel 2.3 using java DSL to with a route like that:
>
> from("direct:EmRequests")
>        .log("request's Body is ${in.body}")
>
>        .choice()
>        .when(bean("EmLoginBean","isLoggedIn").isNotEqualTo(constant(true)))
>
>                .doTry()
>                        .process(new EmLoginProcessor())
>                        .to(cxfSessionFactory)
>                        .process(new EmProcessor())
>                        .log("Response back to the caller ${body}")
>
> .choice().when(property("MarshalAndUnmarshal").isEqualTo(constant(true)))
> //
> gives me a compilation error
>                        .convertBodyTo(String.class)
>                        .end()
>                .doCatch(ECIEPermissionDenied.class,ECIESystemDown.class)
>                .process(new ExceptionProcessorHandler())
>                .end()
>
>        .end();
>
> I get the following compilation error if I put a choice() inside the doTry.
> Here it is "The method doCatch(Class<ECIEPermissionDenied>,
> Class<ECIESystemDown>) is undefined for the type ProcessorDefinition"
>
> So I tried to put it as a separate Predicate like that:
>
>
> Predicate pred =
> choice().when(property("MarshalAndUnmarshal").isEqualTo(constant(true)))
>                .convertBodyTo(String.class)
>                .end();
>
> However, I get this compilation error : "The method choice() is undefined
> for the type MyRouteBuilder"
>
> Is there a way to successfully write this Predicate?
>
> thanks,
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/writing-a-choice-predicate-tp2651153p2651153.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to