Hi

You need to use the correct syntax with ${ }
       <camel:simple>$body.type is 'my.domain.ClassA'</camel:simple>

Should be
       <camel:simple>${body} is 'my.domain.ClassA'</camel:simple>


On Mon, Sep 21, 2009 at 4:26 PM, aptesameer <[email protected]> wrote:
>
> Hi,
>
> I have defined a route as follows, where in based on the class type of the
> object returned by the servicebean method I want to try some header.
>
> However no matter what, it always sets the header value to all exchanges
> even if the body has object of some other type.
>
> I suspect that probably simple expression is being incorrectly configured by
> me.
>
> Any idea?
>
> Thnaks
> Sameer
>
> <camel:route>
>        <camel:from ref="inboundQ" />
>        <camel:unmarshal>
>                <camel:jaxb contextPath="packagename.where.objectfactory.is" />
>        </camel:unmarshal>
>        <camel:bean ref="servicebean" />
>        <camel:choice>
>                        <camel:when>
>                                <camel:simple>$body.type is 
> 'my.domain.ClassA'</camel:simple>
>                                <camel:setHeader headerName="myHeader">
>                                        
> <camel:constant>headervalue</camel:constant>
>                                </camel:setHeader>
>                        </camel:when>
>        </camel:choice>
>        <camel:to ref="outboundQ"></camel:to>
> </camel:route>
> --
> View this message in context: 
> http://www.nabble.com/%27body.type-is%27-not-working%21-tp25530344p25530344.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to