It's all about the answers!

Ask a question

Need a sample java like while loop in build forge step


Tamaljit Dey (1612) | asked Sep 08 '14, 10:14 p.m.
 I  need to have a while loop  which will execute the step  4 times.During each iteration I need to increase a counter which can be a env variable.need details example.while condition check will be done on this environment variable.

One answer



permanent link
Ryan Ruscett (1.0k413) | answered Sep 11 '14, 9:43 a.m.
 Hello,

The way it works is like this. 

You create and or set a Build Forge variable to, in your case 4. So say COUNTER=4. Whether you .bset this in the product or set it as a variable within the environment it wont matter. 

Condition:
true(${BF_ITERAT$ION}<={COUNTER})   <--- What that does is say iterate until COUNTER is = to 4. So  4 times. 

What are we iteration?
Command
echo "Whatever I want"   <--- Means this command runs 4 times, or until the value of counter is reached. 


Does this help clear it up for you?

Please also be aware you can use Thread to thread steps and or thread conditional steps to run all 4 at the same time to increase performance etc. 

Please let me know if this helps and if so, please like the answer. If not, let me know and I can try further. Thanks!

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.