Hi
BTW its also possible to use predicates without it being a parameter
to the when DSL.
However then its a bit limited what you can do as you cannot invoke
sub methods as the Java compiler will get confused, as you cannot
"step back" into the route DSL mode, so to speak.
However in some cases that is fine if you for instance is doing a
xpath predicate that just needs a single parameter with the xpath
itself.
when().xpath("/orders/item = 'Mac'").to("jms:queue:mac")
This allows you to leverage code competion a bit more as you can press
ctrl + space after: when().
and find the possible combinations you can do.
On Thu, Apr 16, 2009 at 3:52 PM, Ashwin Karpe <[email protected]> wrote:
>
> Hi,
>
> You are correct. The proper syntax should be
>
> from("seda:a").choice().when(header("foo").isEqualTo("bar")).to("seda:b")
>
> Cheers,
>
> Ashwin...
>
>
> Joe Fernandez wrote:
>>
>> Re the subject web page and this block of sample code found at the top of
>> the page.
>>
>> from("jms:queue:order")
>> .choice()
>> .when().header("type").isEqualTo("widget").to("bean:widgetOrder")
>> .when().header("type").isEqualTo("wombat").to("bean:wombatOrder")
>> .otherwise()
>> .to("bean:miscOrder")
>> .end();
>>
>> Is the proper syntax being used for the 'when' predicates? Shouldn't it be
>> like this?
>>
>> .when(header("type").isEqualTo("widget")).to("bean:widgetOrder")
>> .when(header("type").isEqualTo("wombat")).to("bean:wombatOrder")
>>
>> Thanks,
>> Joe
>>
>
>
> -----
> ---
> Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence
> Progress Software Corporation
> 14 Oak Park Drive
> Bedford, MA 01730
> ---
> +1-972-304-9084 (Office)
> +1-972-971-1700 (Mobile)
> ----
> Blog: http://opensourceknowledge.blogspot.com/
>
>
> --
> View this message in context:
> http://www.nabble.com/camel.apache.org-predicate.html-tp23078145p23078434.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>
--
Claus Ibsen
Apache Camel Committer
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Apache Camel Reference Card:
http://refcardz.dzone.com/refcardz/enterprise-integration