camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gert Vanthienen <>
Subject Re: When().choice() & Filter() DSL not supported together !!
Date Wed, 09 Jul 2008 07:35:11 GMT

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) 

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 

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 for some examples).



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

View raw message