camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmoulliard <cmoulli...@gmail.com>
Subject Re: When().choice() & Filter() DSL not supported together !!
Date Wed, 09 Jul 2008 07:52:36 GMT



Gert Vanthienen wrote:
> 
> Charles,
> 
> The end() method returns the raw ProcessorType.  You need a ChoiceType 
> in order to be able to access the otherwise() method.
> One option would be to assign the result of from("")....end() to a local 
> variable of type ChoiceType -- adding the necessary cast.  Afterwards, 
> you can add the otherwise().  Somthing like:
>   ChoiceType choice = (ChoiceType) 
> from("").choice().when()....to("queue:A").end();
>   choice.otherwise.to("queue:A")
> 
> Another option would be to extract the routing logic for the first 
> when() clause in a separate route (starting with e.g. a direct: style 
> endpoint) and just code 
> when().xpath().to("direct:when1").otherwise().to("queue:B").
> 
> We are currently adding a Scala DSL, which will allow you to use {} to 
> explicitly define the blocks in your routes (have a look at 
> http://activemq.apache.org/camel/scala-dsl-eip.html for some examples).
> 
> Regards,
> 
> Gert
> 
> cmoulliard wrote:
>> Hi,
>>
>> I would lie to know why the following route cannot be configurated and if
>> there is a workaround ?
>>
>> from("")
>> .choice()
>> .when.xpath("")
>>         .setHeader("name").xpath("")
>>         .filter().xquery("extract a part of the XML")
>>             .unmarshall()
>>         .to("queue:A")
>>         .end()
>> .otherwise().to("queue:B"); 
>>
>> Regards,
>>
>> charles
>>   
> 
> 
> 
> -----
> ---
> Gert Vanthienen
> http://www.anova.be
> 
:clap:
-- 
View this message in context: http://www.nabble.com/When%28%29.choice%28%29---Filter%28%29-DSL-not-supported-together-%21%21-tp18355221s22882p18356297.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message