Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ashis
Creator III
Creator III

QMC Job dependency and trigger child jobs

Hi ,

I have few jobs set up in QMC , for example 

AAA - Parent job (scheduled it , time based)

       BBB - Child of AAA (AFTER SUCCESSFULLY COMPLETION OF AAA SHOULD BE TRIGGERED)

            CCC - Child of BBB (AFTER SUCCESSFULLY COMPLETION OF BBB SHOULD BE TRIGGERED

what is happening when CCC job is running before finishing it AAA getting starts, 

we want AAA job start only when all of its child jobs are finished , otherwise it should wait.

I do not find a way to do it . Is there any way to do it ?

 

Thank you,

 

Labels (1)
  • johnw

10 Replies
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hello Ashissau,

 

If there is a trigger that should start a job while it is running, it will be ignored.

If you want it to wait, you should use some FileTime() checks at the end of "BBB" and SLEEP function to manually delay it's completion when you are certain CCC has finished so when BBB ends, CCC will be in a "ready-to-start" mode.

 

I hope that helps!

Kind regards,

S.T.

ashis
Creator III
Creator III
Author

Hi ST,

Actually when CCC is running  (and did not finish it ) ,AAA starts if it is triggered time based (lets say every hour) . it does not ignore evenif CCC is running.

Thank you for the suggestion to add time check and sleep function . do you have any example please.

Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hello Ashissau,

 

If you have the proper data load sequence that shouldn't be a problem.

CCC running should be a consumer of that previous completion of AAA has to offer.

It's perfectly okay for CCC to run while AAA is picking and reloading new fresh data.

 

Just make sure none of the qvds created by AAA are picked by CCC to avoid mixing old and new data.

 

To ensure AAA will always start after CCC has completed, you can do this in the start of AAA script:

DO WHILE FileTime(CCC)<Today(2)
SLEEP 10000;

 

I hope that helps!

 

Kind regards,

S.T.

ashis
Creator III
Creator III
Author

Thank you ST for your suggest. 

what is today(2) mean.

Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hello Ashissau,

 

Today(2) is the time at which the document was opened.

So it will take the time AAA was opened.

 

Once CCC ends, the time of the CCC file will be > than the time AAA was opened and AAA can start. 

 

Keep in mind that's super simplified methodology that may need to be further enhanced with other conditions to work for production purposes.

 

I hope that helps!

 

Kind regards,

S.T.

ashis
Creator III
Creator III
Author

Thank you ST, will try your suggestion.

Brett_Bleess
Former Employee
Former Employee

Ashis, there is an even easier means to do this, simply configure all three tasks to start on successful completion of the preceding task, and then you manually start the first task to kick off the loop and from there, it runs through until any task has a failure.  If you want things to run regardless of success or failure, you need to configure the on failure trigger as well.  I believe this is more for what you were looking, and it is a bit counter intuitive, but it will work just fine, the trick is knowing you have to manually kick the first task to start the loop.  

So, in your case you would change the trigger on AAA to be On Successful Completion of CCC instead of the scheduled trigger etc. and then manually trigger AAA to get the loop going.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
ashis
Creator III
Creator III
Author

Hi Brett,

Thank you for your reply. Actually i thought of this earlier however it did not work out since there is a manual trigger needed to start AAA job for the looping. We do not want it to be trigger manually. 

Thank you.

ashis
Creator III
Creator III
Author

Hi Stoyan,

I was trying to put your code in my load script and it seems it is going to sleep ,

I put this two line at the starting of my load script in AAA script.

DO WHILE FileTime('..\06_Apps\CCC.qvw')<Today(2);
SLEEP 10000;

It seems it is not loading my rest of the script. 

Any thought.