Page 1 of 1

Schedule- Repeat Condition

Posted: Tue Jun 21, 2016 7:58 am
by ernguyen
Does anyone have an example of using the repeat options- condition in a schedule?

Re: Schedule- Repeat Condition

Posted: Tue Jun 27, 2017 12:15 pm
by dfinlayson
I also would like to understand how to conditionally repeat inside a schedule.

Support, could you explain or refer to documentation ?

Re: Schedule- Repeat Condition

Posted: Tue Jun 27, 2017 12:51 pm
by Support_Tim
Hi Dfinlayson,
Thanks for your post.
This works like a do-while loop with a delay, only it is outside of the actual project. There is a nice example in the GA MFT Help text which you can get to by clicking the "?" at the upper right of the schedule tab screen. Then navigate to the "Repeat Options" section. Here is an excerpt:

Example 3 - Repeat when a Specified Condition is Met: After the Project has executed at the scheduled time, the Schedule will receive the current value of the Project Variables. The Schedule will then test a Project Variable for the repeat condition, and if the condition is evaluated to true, the Job will be repeated.

Scenario:
Every day at 10 AM you expect 30 files from the Accounting department to be placed in a designated folder for processing. You cannot process the files until all 30 of them have been created.

Solution:
You first create a Project that uses the Create File List task to assign the number of files found in the directory to a variable named "myVar." You then add a decision to the project that will exit the Project if the correct number of files do not exist.

You next create a Schedule that runs Daily with a start time of 10 AM. The project will repeat if a Specified condition is met. The condition evaluates the value of myVar that was supplied from the Project. If the value is less than 30, the Job will be repeated at the designated time. The repeat condition is tested each time the Job is run. Once the condition evaluates to false (the correct number of files exist) the Job is no longer repeated.

The Schedule executes the Project at the designated time, and only 15 files are found. The value of myVar is now 15, and the variable is returned to the Schedule. The Schedule tests the value of the variable against the condition, 15 < 30, which is true. The Job will repeat at the designated time for the specified duration.
Schedule Job Repeat Options
1 minute later the Job is executed. Accounting has finished generating the 30 files, and after the Project completes the value of the variable (30) is returned to the Schedule and the condition is tested again. 30 is not less than 30, so the condition is false. The Job will not be repeated today.

Re: Schedule- Repeat Condition

Posted: Thu Jun 29, 2017 10:12 am
by dfinlayson
Thanks for the response Tim. I followed the steps to find this in the documentation but couldn't find it. Could you tell me what version it is ?

Re: Schedule- Repeat Condition

Posted: Thu Jun 29, 2017 11:57 am
by Support_Tim
I copied this from GA version 5.5. I just checked and see there are different examples in 5.4 with no picture, so it is fairly new. I did copy the entire section so now you have it here.