I know loop activity has numeric and list loops. Is there a way to define a time based loop? I want to run my job until it produces a specific value.
For example,
I want to check row count in a table and if it is 0 I want to rerun the job after 5 minutes.
Or
I want to query a DB catalog to see if certain Mview has been refreshed and is ready for downstream processes.
Appreciate your help.
Thank
Anu.
Loop Activity on Time interval
Moderators: chulett, rschirm, roy
Loop Activity on Time interval
Thank you,
Anu
Anu
You can accomplish this in a job sequence.
Write a Server Job to test for the database condition you are looking for and output a Go / No Go message to the UserStatus variable. You can test for that in a nested condition and decide to either go sleep and repeat the loop or execute Job #2.
I've never done it, but I believe using a Sequencer you could funnel Job#2 back into the "loop" prior to the EndLoop so you could continue the "Test / Sleep / Execute" cycle.
Code: Select all
StartLoop -> Job#1 -> N. Condition (Not ok) -> ExCmd Sleep -> EndLoop
(ok) -> Job#2
I've never done it, but I believe using a Sequencer you could funnel Job#2 back into the "loop" prior to the EndLoop so you could continue the "Test / Sleep / Execute" cycle.
Last edited by asorrell on Wed Sep 18, 2013 9:25 am, edited 2 times in total.
So answer is no, at least not directly. I've done "time based" loops by setting a duration for each loop and then looping how ever many times it would take for that number of loops to hit my end time. You can also use a custom routine to check the current time inside the loop and exit (branch outside the End Loop stage) when your time limit has passed.
For example, your first problem could be solved by looping until the condition is met and then using a routine to "sleep 5" before the next step that runs the job. Condition not met? Branch around the Routine and Job Activity stages inside the loop.
All kinds of ways to skin this cat.
For example, your first problem could be solved by looping until the condition is met and then using a routine to "sleep 5" before the next step that runs the job. Condition not met? Branch around the Routine and Job Activity stages inside the loop.
All kinds of ways to skin this cat.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
I have and yes you can via a Sequencer set to 'Any'.asorrell wrote:I've never done it, but I believe using a Sequencer you could funnel Job#2 back into the "loop" prior to the EndLoop so you could continue the "Test / Sleep / Execute" cycle.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers