I woudl like to change a flow variable (replace) in a loop and the loops ends when the variable meets the condition. Problem is that the variable seems to be “reset” to the initial value for each iteration. I tired setting variable by Java Edit Variable and TableRowToVariable Nodes but it does not change anything.
How can I get the next iteration to chose the newly set value?
see attached file for a very basic version of what I mean. In my case the snippet increases the variable by 1 correctly but on the next iteration its initial value is 0 again.
I am not 100% but my guess is that the variable value after configure and after execute is different, this is a know limitation and will be fixed for 2.8 -- you can use the Java Snippet (simple) which executes the Java code also during the configure step. Does this help at all?
Delegating nodes is the way, but admittedly this is not easy stuff. The nodes really should be called recursive loop start and end to make them more user accessible!
the table row to variable loop start and have a predefined table list to feed into this node certainly simplifies the usage.
If you are simply incrementing the variable, then you can also use the counting loop start node.
infact every loop generates an additional variable called current iteration which increases the number by 1, starting with 0. This could be useful.