You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Thibault <th...@gmail.com> on 2012/03/16 15:53:15 UTC

Choice() When() always generate empty predicate

Hi all,

I have this DSL route definition:


> from("seda:InTransform")
>    .choice()
>        .when(property("input.format").isEqualsTo("test"))
>           .to("jbi:endpoint:MyService:MyEndpoint")
>        .otherwise()
>           .to("jbi:endpoint:AnotherService:AnotherEndpoint");
> 

(I want to test a value that i have already set as "input.format" property)
The DSL compiles, but when I show the route on Karaf (camel:show-route), it
only displays this:



> (...)
> <choice>
>   <when>
>       <expressionDefinition />
>       <to uri="jbi:endpoint:MyService:MyEndpoint" id="to3"/>
>   </when>
>   <otherwise>
>      (...)
>   </otherwise>
> </choice>
> (...)
> 
Why doesn't the predicate on the property "input.format" appear in the route
? Did I write something wrong ?

Regards,
Thibault


--
View this message in context: http://camel.465427.n5.nabble.com/Choice-When-always-generate-empty-predicate-tp5571443p5571443.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Choice() When() always generate empty predicate

Posted by Thibault <th...@gmail.com>.
Hi,

This solution works perfectly. Thanks you very much.

Regards,
Thibault

2012/3/16 Marco Westermann [via Camel] <
ml-node+s465427n5571617h62@n5.nabble.com>

> Hi, you may try building the predicat by simple language:
>
> .when(simple("${property.input.format} == 'test'"))
>
> compare to http://camel.apache.org/simple.html
>
> regards, marco
>
> Am 16.03.2012 15:53, schrieb Thibault:
>
> > Hi all,
> >
> > I have this DSL route definition:
> >
> >
> >> from("seda:InTransform")
> >>     .choice()
> >>         .when(property("input.format").isEqualsTo("test"))
> >>            .to("jbi:endpoint:MyService:MyEndpoint")
> >>         .otherwise()
> >>            .to("jbi:endpoint:AnotherService:AnotherEndpoint");
> >>
> > (I want to test a value that i have already set as "input.format"
> property)
> > The DSL compiles, but when I show the route on Karaf (camel:show-route),
> it
> > only displays this:
> >
> >
> >
> >> (...)
> >> <choice>
> >>    <when>
> >>        <expressionDefinition />
> >>        <to uri="jbi:endpoint:MyService:MyEndpoint" id="to3"/>
> >>    </when>
> >>    <otherwise>
> >>       (...)
> >>    </otherwise>
> >> </choice>
> >> (...)
> >>
> > Why doesn't the predicate on the property "input.format" appear in the
> route
> > ? Did I write something wrong ?
> >
> > Regards,
> > Thibault
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Choice-When-always-generate-empty-predicate-tp5571443p5571443.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Choice-When-always-generate-empty-predicate-tp5571443p5571617.html
>  To unsubscribe from Choice() When() always generate empty predicate, click
> here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5571443&code=dGhpYmF1bHQuY2Fzc2FuQGdtYWlsLmNvbXw1NTcxNDQzfDEyMTg5MTAyNjc=>
> .
> 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>
>


--
View this message in context: http://camel.465427.n5.nabble.com/Choice-When-always-generate-empty-predicate-tp5571443p5576952.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Choice() When() always generate empty predicate

Posted by Marco Westermann <Ma...@gmx.de>.
Hi, you may try building the predicat by simple language:

.when(simple("${property.input.format} == 'test'"))

compare to http://camel.apache.org/simple.html

regards, marco

Am 16.03.2012 15:53, schrieb Thibault:
> Hi all,
>
> I have this DSL route definition:
>
>
>> from("seda:InTransform")
>>     .choice()
>>         .when(property("input.format").isEqualsTo("test"))
>>            .to("jbi:endpoint:MyService:MyEndpoint")
>>         .otherwise()
>>            .to("jbi:endpoint:AnotherService:AnotherEndpoint");
>>
> (I want to test a value that i have already set as "input.format" property)
> The DSL compiles, but when I show the route on Karaf (camel:show-route), it
> only displays this:
>
>
>
>> (...)
>> <choice>
>>    <when>
>>        <expressionDefinition />
>>        <to uri="jbi:endpoint:MyService:MyEndpoint" id="to3"/>
>>    </when>
>>    <otherwise>
>>       (...)
>>    </otherwise>
>> </choice>
>> (...)
>>
> Why doesn't the predicate on the property "input.format" appear in the route
> ? Did I write something wrong ?
>
> Regards,
> Thibault
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Choice-When-always-generate-empty-predicate-tp5571443p5571443.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Choice() When() always generate empty predicate

Posted by Thibault <th...@gmail.com>.
Hi,

Seems that I use the version 2011.02 of the servicemix-camel component.
Since I don't see any newer version (or I don't know how to get them), I
will try to use a simple expression, like said in another answer.

Regards,
Thibault

2012/3/16 Claus Ibsen-2 [via Camel] <
ml-node+s465427n5571592h87@n5.nabble.com>

> Hi
>
> What version of Camel are you using?
> I think those are fixed on one of the later releases.
>
>
> On Fri, Mar 16, 2012 at 3:53 PM, Thibault <[hidden email]<http://user/SendEmail.jtp?type=node&node=5571592&i=0>>
> wrote:
>
> > Hi all,
> >
> > I have this DSL route definition:
> >
> >
> >> from("seda:InTransform")
> >>    .choice()
> >>        .when(property("input.format").isEqualsTo("test"))
> >>           .to("jbi:endpoint:MyService:MyEndpoint")
> >>        .otherwise()
> >>           .to("jbi:endpoint:AnotherService:AnotherEndpoint");
> >>
> >
> > (I want to test a value that i have already set as "input.format"
> property)
> > The DSL compiles, but when I show the route on Karaf (camel:show-route),
> it
> > only displays this:
> >
> >
> >
> >> (...)
> >> <choice>
> >>   <when>
> >>       <expressionDefinition />
> >>       <to uri="jbi:endpoint:MyService:MyEndpoint" id="to3"/>
> >>   </when>
> >>   <otherwise>
> >>      (...)
> >>   </otherwise>
> >> </choice>
> >> (...)
> >>
> > Why doesn't the predicate on the property "input.format" appear in the
> route
> > ? Did I write something wrong ?
> >
> > Regards,
> > Thibault
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Choice-When-always-generate-empty-predicate-tp5571443p5571443.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
> FuseSource
> Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=5571592&i=1>
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.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/Choice-When-always-generate-empty-predicate-tp5571443p5571592.html
> To unsubscribe from Choice() When() always generate empty predicate, click
> here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5571443&code=dGhpYmF1bHQuY2Fzc2FuQGdtYWlsLmNvbXw1NTcxNDQzfDEyMTg5MTAyNjc=>
> .
> 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>
>


--
View this message in context: http://camel.465427.n5.nabble.com/Choice-When-always-generate-empty-predicate-tp5571443p5576422.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Choice() When() always generate empty predicate

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

What version of Camel are you using?
I think those are fixed on one of the later releases.


On Fri, Mar 16, 2012 at 3:53 PM, Thibault <th...@gmail.com> wrote:
> Hi all,
>
> I have this DSL route definition:
>
>
>> from("seda:InTransform")
>>    .choice()
>>        .when(property("input.format").isEqualsTo("test"))
>>           .to("jbi:endpoint:MyService:MyEndpoint")
>>        .otherwise()
>>           .to("jbi:endpoint:AnotherService:AnotherEndpoint");
>>
>
> (I want to test a value that i have already set as "input.format" property)
> The DSL compiles, but when I show the route on Karaf (camel:show-route), it
> only displays this:
>
>
>
>> (...)
>> <choice>
>>   <when>
>>       <expressionDefinition />
>>       <to uri="jbi:endpoint:MyService:MyEndpoint" id="to3"/>
>>   </when>
>>   <otherwise>
>>      (...)
>>   </otherwise>
>> </choice>
>> (...)
>>
> Why doesn't the predicate on the property "input.format" appear in the route
> ? Did I write something wrong ?
>
> Regards,
> Thibault
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Choice-When-always-generate-empty-predicate-tp5571443p5571443.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/