On Tue, Oct 8, 2013 at 11:10 AM, prabumc...@gmail.com <prabumc...@gmail.com> wrote: > Thanks you so much,It work now.. > > One more doubt. > > .filter(simple("${body[isCredit]} == true")) > > Body is map message and *isCredit* is key and value is true/false (boolean > value) >
Yeah that is what the predicate above will test for. Lookup a key 'isCredit' from the body as a Map type. And compare it to a boolean true value. > I want check is it true or false and read key and value from constant value > > How can i do that? > I dont understand what you want here? Which constant value do you want to read? > *Regards* > Prabu.N > > > On Tue, Oct 8, 2013 at 12:22 PM, Claus Ibsen-2 [via Camel] < > ml-node+s465427n5741082...@n5.nabble.com> wrote: > >> Hi >> >> The filter simple predicate is wrong >> >> > .filter(simple("{body[isCredit]} == true")) >> >> See syntax on the simple docs, eg use ${ } as the tokens. >> >> On Tue, Oct 8, 2013 at 8:49 AM, [hidden >> email]<http://user/SendEmail.jtp?type=node&node=5741082&i=0> >> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5741082&i=1>> >> wrote: >> >> > Hi All, >> > >> > I am having added below code in my camel routing,but it not work at >> all. >> > >> > I want to use when and filter both for my routing >> > >> > from(ACT_TYPE_SPECFIC_QNAME).choice() >> > .when(header(EVENT_TYPE).isEqualTo(ACT_TRANSACTION)) >> > .filter(simple("{body[isCredit]} == true")) >> > .process(new Processor() { >> > public void process(Exchange exchange) { >> > Map map = (Map) exchange.getIn().getBody(); >> > String Account_No = (String) map.get(ACCOUNT_ID); >> > Map<String,Object> newBody = new HashMap<String, Object>(); >> > newBody.put(ACCOUNT_ID, Account_No); >> > exchange.getIn().setBody(newBody); >> > }}).to(ACTIVATE_QNAME).endChoice() >> > .otherwise() >> > .setHeader(DESTINATION, constant(DESTINATION_VALUE)) >> > .to(EROOR_QNAME) >> > .end(); >> > >> > I also added .endChoice() like you suggest...but ti didn't work pls >> kindly >> > help me. >> > >> > >> > >> > >> > >> > -- >> > View this message in context: >> http://camel.465427.n5.nabble.com/using-filter-inside-when-tp5652300p5741081.html >> > Sent from the Camel - Users mailing list archive at Nabble.com. >> >> >> >> -- >> Claus Ibsen >> ----------------- >> Red Hat, Inc. >> Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=5741082&i=2> >> Twitter: davsclaus >> Blog: http://davsclaus.com >> Author of Camel in Action: http://www.manning.com/ibsen >> >> >> ------------------------------ >> If you reply to this email, your message will be added to the discussion >> below: >> >> http://camel.465427.n5.nabble.com/using-filter-inside-when-tp5652300p5741082.html >> To unsubscribe from using filter inside when?, click >> here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5652300&code=cHJhYnVtY2EwNkBnbWFpbC5jb218NTY1MjMwMHw4OTY0MTU3ODg=> >> . >> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >> > > > > -- > Thanks & Regards > Prabu.N > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/using-filter-inside-when-tp5652300p5741111.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen