Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


michaelhum
2018-04-23T15:54:54Z
A request for a feature.

Can you consider adding the ability to create NESTED Loops.

I have a number of jobs with Tasks in Loops. The loops are identical with the exception of a variable. Support for Nested loops would eliminate a lot of repetitive loops and tasks


Example of a Nested Loop

For X=1 to Variable A
For X=1 to 3
Task 1
Task 2
EndLoop
EndLoop



Sponsor
Forum information
westede
2018-04-25T14:09:25Z
yeah, this would be a nice feature
michaelhum
2018-04-25T14:14:28Z
I literally have a job which has close to 200 tasks. The tasks are pretty much a repeat of a few tasks inside a loop. I figure, with the nested loop capability, this job would be reduced to 15 tasks.
ErikC
2018-04-26T06:01:06Z
Hi michaelhum,

I know this is not possible at the moment, but there is a way to have a nested loop. This is how I do it:

Split the job in two seperate jobs. Let one job (master job) run the other (slave job) passing the loop variables as job variables.
This way your slave job can also have a loop. In this slave job you can access the master loop variables by its own job variables and it can use its own loop variables.

Master job
For X=1 to Variable A
task 1
task 2: Run slave job passing my loop variables
task 3
EndLoop

Slave job
For X=1 to 3
Task 1 using job variables and own loop variables
Task 2
EndLoop

Now you have a nested loop. 😁

Regards,
Erik
Uses Visualcron since 2006.
westede
2018-04-26T06:16:41Z
That is correct, but i would be much easier to have it in one job 😉


Originally Posted by: ErikC 

Hi michaelhum,

I know this is not possible at the moment, but there is a way to have a nested loop. This is how I do it:

Split the job in two seperate jobs. Let one job (master job) run the other (slave job) passing the loop variables as job variables.
This way your slave job can also have a loop. In this slave job you can access the master loop variables by its own job variables and it can use its own loop variables.

Now you have a nested loop. 😁

Regards,
Erik



michaelhum
2018-04-26T14:29:55Z
Hi,
Thanks for the suggestion. I was planning to do that as well..."master job" calling other jobs to sort of simulate a nested loop. The other challenge I'm facing which doesn't make the suggestion optimal for my environment is, I have over 1100++ jobs scheduled with VisualCron. Having a calling problem would make it a little more difficult for my operations team to triage when a job fails.

Having said this, lack of Nested loops doesn't diminish the overall feature set VisualCron offers. VisualCron is by far the best scheduling/automation software I've used in my 30 years + in IT.


Scroll to Top