You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by j_pramanik_ind <ja...@gmail.com> on 2017/02/02 07:35:43 UTC

Conditional route definition in Spring XML DSL with Camel 2.14.2

Hi,

Can I define any route with any condition ? Currently I'm using Camel 2.14.2
version. Any opportunity is there so that I am willing to execute the route
based on particular condition ?

My requirement : Actually I want to delete the file conditionally. If I can
put some condition on "delete" parameter that will work also. Then, in that
case no need to write another route based on condition. Please check the XML
DSL part furnished below. Where if I can place the "delete=true" within
condition it would work for me. Another thought - if I can set the value for
"delete" parameter dynamically that may work for me also. Say, delete=${var}
; Can I do this ? Please 

Here is my Camel XML DSL containing route definition: 

            <route id="route1">
			<from uri="file:\\home\allreports\reports?delete=true" />
			<doTry>
				<process ref="inwardProcessorYesb" />
				<doCatch>
					
					<exception>java.io.IOException</exception>
					<exception>java.lang.IllegalStateException</exception>
					<exception>java.lang.Exception</exception>
				</doCatch>
			</doTry>
		</route>



Any help would be appreciated.

Thanks in advance,

Jayanta Pramanik

 



--
View this message in context: http://camel.465427.n5.nabble.com/Conditional-route-definition-in-Spring-XML-DSL-with-Camel-2-14-2-tp5793343.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Conditional route definition in Spring XML DSL with Camel 2.14.2

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Please use the @user mailing list / user forum for these kind of
questions (not  the dev).

On Thu, Feb 2, 2017 at 8:35 AM, j_pramanik_ind
<ja...@gmail.com> wrote:
> Hi,
>
> Can I define any route with any condition ? Currently I'm using Camel 2.14.2
> version. Any opportunity is there so that I am willing to execute the route
> based on particular condition ?
>
> My requirement : Actually I want to delete the file conditionally. If I can
> put some condition on "delete" parameter that will work also. Then, in that
> case no need to write another route based on condition. Please check the XML
> DSL part furnished below. Where if I can place the "delete=true" within
> condition it would work for me. Another thought - if I can set the value for
> "delete" parameter dynamically that may work for me also. Say, delete=${var}
> ; Can I do this ? Please
>
> Here is my Camel XML DSL containing route definition:
>
>             <route id="route1">
>                         <from uri="file:\\home\allreports\reports?delete=true" />
>                         <doTry>
>                                 <process ref="inwardProcessorYesb" />
>                                 <doCatch>
>
>                                         <exception>java.io.IOException</exception>
>                                         <exception>java.lang.IllegalStateException</exception>
>                                         <exception>java.lang.Exception</exception>
>                                 </doCatch>
>                         </doTry>
>                 </route>
>
>
>
> Any help would be appreciated.
>
> Thanks in advance,
>
> Jayanta Pramanik
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Conditional-route-definition-in-Spring-XML-DSL-with-Camel-2-14-2-tp5793343.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2