You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "shekher.awasthi" <sh...@gmail.com> on 2011/08/18 14:26:18 UTC

choice i snot working in Spring XML

Hi All,

I am trying following Predicate using spring 

 <route id="rXMLToImpex">   
	        <from uri="{{rXMLToImpex.sourceXMLFilePath}}"/>
	      <choice>
          <when>
           <simple>${file:ext} =='csv'</simple>
           <unmarshal>
	                <csv/>
	       </unmarshal>
	       <to uri="bean:csvToXMLConverter?method=processCSVInvoice" />
       </when>
        </choice>
	        <to uri="{{rXMLToImpex.tmpXMLtoStandardXMLXslFilePath}}"/>
	        <to uri="{{rXMLToImpex.StandardXMLToImpexXslFilePath}}"/>
	        <to uri="{{rXMLToImpex.targetXMLFilePath}}"/>       
	    </route>

But this is not working as per my expectation as even when the file
extension is not csv log message showing that this predicates is getting
evaluated as true.
Can any one help me what i am doing wrong here

--
View this message in context: http://camel.465427.n5.nabble.com/choice-i-snot-working-in-Spring-XML-tp4711897p4711897.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: choice i snot working in Spring XML

Posted by "shekher.awasthi" <sh...@gmail.com>.
Claus though i able to solve my problem by creating a bean and from exchange
got the file name and than extract the extension from there.

is there any other way beside this like i can do that XML file,though i
tried <xpath> <el> <ognl> but was confused how i can get file extension
there without using any java code

--
View this message in context: http://camel.465427.n5.nabble.com/choice-i-snot-working-in-Spring-XML-tp4711897p4711999.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: choice i snot working in Spring XML

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Aug 18, 2011 at 2:26 PM, shekher.awasthi
<sh...@gmail.com> wrote:
> Hi All,
>
> I am trying following Predicate using spring
>
>  <route id="rXMLToImpex">
>                <from uri="{{rXMLToImpex.sourceXMLFilePath}}"/>
>              <choice>
>          <when>
>           <simple>${file:ext} =='csv'</simple>
>           <unmarshal>
>                        <csv/>
>               </unmarshal>
>               <to uri="bean:csvToXMLConverter?method=processCSVInvoice" />
>       </when>
>        </choice>
>                <to uri="{{rXMLToImpex.tmpXMLtoStandardXMLXslFilePath}}"/>
>                <to uri="{{rXMLToImpex.StandardXMLToImpexXslFilePath}}"/>
>                <to uri="{{rXMLToImpex.targetXMLFilePath}}"/>
>            </route>
>
> But this is not working as per my expectation as even when the file
> extension is not csv log message showing that this predicates is getting
> evaluated as true.
> Can any one help me what i am doing wrong here
>

Make sure you have spaces around the == operator.

Its mentioned on the wiki page
http://camel.apache.org/simple

> --
> View this message in context: http://camel.465427.n5.nabble.com/choice-i-snot-working-in-Spring-XML-tp4711897p4711897.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/