Hi
The loop uses an expression to know how many times to loop. Its a
fixed loop (not a while), and the expression is evaluated once.
So you cannot change number of times to loop etc.
So for example to loop 3 times use
<constant>3</constant>
If you have a a header in the message that has a counter then you can
use that etc
Though it looks as you want to loop a list, which you have stored as a property
So something a like
<loop>
<simple>${property.testList.size}</simple>
...
</loop>
The loop is documented at
http://camel.apache.org/loop
On Wed, Nov 20, 2013 at 11:33 PM, chaudhariamit
<[email protected]> wrote:
> Hi,
>
> I am trying to use Camel Loop as below in the camel-context.xml file -
>
> <camel:loop>
>
> <camel:constant>${property.CamelLoopSize}</camel:constant>
>
> <camel:setBody>
> <camel:simple>
> UPDATE test SET test_score=
> ${property.testList[${property.CamelLoopIndex}].testScore} WHERE
> partner_member_id = ${property.testList[${property.CamelLoopIndex}].testId};
> </camel:simple>
> </camel:setBody>
> </camel:loop>
>
> Please let me know if i am missing anything here as it looks like i am not
> able to figure out the syntax for setting the Loop size.(CamelLoopIndex
> works fine if i set a constant manually)
>
> Thanks,
> Amit
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Facing-issues-in-using-Camel-Loop-tp5743589.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen