buchnerm wrote:
Sorry but none of your methods worked - any other suggestions? Links to
tutorials?
greetings max


Max,

Did you take a look at the following test cases?

http://svn.apache.org/repos/asf/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ChoiceTest.java
http://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringChoiceTest.java
http://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/choice.xml

From these it looks like this

               from("direct:start").choice()
.when(header("foo").isEqualTo("bar")).setHeader("name", constant("a")).to("mock:x") .when(header("foo").isEqualTo("cheese")).to("mock:y")
                       .otherwise().to("mock:z");

is equivalent to

   <route>
     <from uri="direct:start"/>
     <choice>
       <when>
         <xpath>$foo = 'bar'</xpath>
         <to uri="mock:x"/>
       </when>
       <when>
         <xpath>$foo = 'cheese'</xpath>
         <to uri="mock:y"/>
       </when>
       <otherwise>
         <to uri="mock:z"/>
       </otherwise>
     </choice>
   </route>

and since this test case is passing, Camel seems to be picking out the headers properly and not the body. Would you mind creating a ticket here http://issues.apache.org/activemq/browse/CAMEL and attaching a test case so we can investigate this case further?

Cheers,
Jon

Reply via email to