Page 1 of 1

Reset the loop when processing data

Posted: Mon Mar 07, 2011 8:41 am
by Chandrathdsx
Hi,

I have a job sequence design that runs in loop for x times with two branches, branch1, if no files to process then it does sleep and keep on running in loop. branch2, if there are files to process then reset the loop limit to start the counter from 1 to run for x times.
Basically I want to run the job x times only when there are no files.
I need help on how to reset the loop counter to start from 1 when the files exist to process?
The requirement is loop the job x times only when there is no files. otherwise (if files are there, keep processing files) x times condition does not apply here. we get the files at regular interval and we have an end of file marker to exit loop if nothing more to process.
Any help is greatly appreciated on how to reset the loop limit counter depending on file exists to process.

Thanks

Re: Reset the loop when processing data

Posted: Mon Mar 07, 2011 12:35 pm
by mkiru23
Setup another stage to check if condition is satisfied in the trigger then send to end stage.

Re: Reset the loop when processing data

Posted: Mon Mar 07, 2011 12:48 pm
by Chandrathdsx
Thanks for the reply..

But, if condtion not satisfied? the loop has to keep running for all it's iterations. I only want to reset the loop counter back to 1 (start of loop) if the data files exist... In another way I want to capture how many times the loop ran with no files and I do not need to increment the loop counted when the file exists.

Posted: Mon Mar 07, 2011 3:22 pm
by ray.wurlod
There is no way to reset the loop index variable.

You can design to bypass activities.

Code: Select all

---> Start Loop  <---------------------------------- End Loop
         |                                              ^
         |                                              |
         V                                              |
   Nested Condition  ----->  Job Activity  ----->  Sequencer
         |                                              ^
         |                                              |
         +----------------------------------------------+