I have devised what I thought was a method of running an infinite loop in a sequence job. Basically a DO WHILE. I will explain the process in a moment but I went for this method as opposed to using the Loop Activity stages because I wanted the loop to exit on a condition, which those activities did not appear they would do.
My job layout is as follows:
Code: Select all
SLP1 SLP2 RUN_JOB
/ ^ / ^ ^
v \ v \ /
WaitFile - - - SEQ1 NC1 - - - SEQ2 NC2
\ ^ \ ^ \
v / v / v
CMD1 CMD2 EMAIL
Sorry for the weird chemical formula looking diagram, my employer does not allow screenshots of anything internal to uploaded. Basically the job is designed to do the following:
Wait for a trigger file, then go to the first sequencer, SEQ1, set to ANY. Flow then continues to CMD1 which checks the status of a job in a different project (dsjob command). This output is sent over the the first Nested Condition, NC1, which runs an index() on the output to see if the job is running or not. If NOT then sends the flow to a sleep command, SLP1, which waits for a time and sends flow back to SEQ1 to repeat until the job being checked is in a running status. At which point flow then hits the second sequencer, SEQ2, set to ANY, and drops down to it's command, CMD2. This checks the same job status again and flows to the second Nested Condition, NC2. Here the job status is checked to see if the job completed, OK or with warnings, or is still running, or is not in any of those statuses. If it's still running SLP2, sleep, will be triggered and flow should go back around to check the status again until the job is completed or failed (no longer running nor completed). If completed, NC2 will trigger the link to run a job. If not completed and not running:
Code: Select all
Index(CheckJobStatus2.$CommandOutput, 'Job Status : RUNNING (0)',1) = 0 Or Index(CheckJobStatus2.$CommandOutput, 'Job Status : RUN with WARNINGS (2)',1) = 0 Or Index(CheckJobStatus2.$CommandOutput, 'Job Status : RUN OK (1)',1) = 0
RawStageTrigger..JobControl (@Coordinator): Note: Sequencer 'SEQ2' was entered, but never exited
Any ideas why?