Hi Yeah simple does not understand EQ, GE, LT and other operators.
You can use some of the other languages - ognl - el - groovy - bean (for using POJO) - xpath if your payload is xml based See http://activemq.apache.org/camel/scripting-languages.html http://activemq.apache.org/camel/ognl.html Using OGNL it would be <ognl>request.headers.foo = 'foo1'</ognl> But I am wondering if we should improve the simple language so it can be use some simple operators for simple test such as in your use-case. No need to learn OGNL, Groovy or depend on 3rd part .jars. Just plain Java. James, any thoughts on this? /Claus Ibsen Apache Camel Committer Blog: http://davsclaus.blogspot.com/ On Wed, Dec 3, 2008 at 1:09 PM, packo <[EMAIL PROTECTED]> wrote: > > It might be a simple question, but i am stuck with it in the past few days so > any help would be appreciated. > > I have a route that looks like this: > > <route> > <from uri="direct:foobar" /> > <choice> > <when> > <simple>${in.headers.foo} == 'foo1'</simple> > <bean ref="fooBean1" /> > </when> > <when> > <simple>${in.headers.foo} == 'foo2'</simple> > <bean ref="fooBean2" /> > </when> > </choice> > <choice> > <when> > <simple>${in.headers.bar } == 'bar1'</simple> > <to uri="bean:barBean?method=barMethod" /> > </when> > </choice> > </route> > > foo and bar headers are pre-populated from the Producer i am using. > What happens is that each expression is evaluated to true. A look in the > code showed that <simple> evaluates just the existence of a header. > I also tried ognl, xpath and others but nothing seems to work. > > My exchange is a default exchange with a DTO as payload. Am i missing > something??? > -- > View this message in context: > http://www.nabble.com/Endpoint-decision-based-on-Header-Value-with-XML-configuration-tp20811772s22882p20811772.html > Sent from the Camel - Users mailing list archive at Nabble.com. > >
