cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2877
Views
0
Helpful
5
Replies

How to lold a Batch Job while other scheduled Jobs are running

ziaul_hoque1
Level 1
Level 1

Hello,

 

I am looking for a solution for a problem I am facing.

I have a Batch job that are running every 5 minutes.

I also have another job group that are running on certain intervals, ie, 12am, 6am, 12pm, etc.

I would like the stop/hold the batch jobs when/while my other scheduled jobs are running and then continue when the scheduled jobs are completed.

Does anyone have any suggestion how to accomplish this?

I would really appreciate any help!

 

Thanks,

Zia

1 Accepted Solution

Accepted Solutions

Hi Cale, the solution worked after I enabled false for the first job in the job group and true for the last job.  Derrick Au gave me a hand on this.

 

Thanks for your help!

View solution in original post

5 Replies 5

Cale Montgomery
Level 1
Level 1
Wow. This place is really turning into a ghost town... I'm surprised this hasn't been answered yet.

As always, my solution to this type of problem would be to use Public Variables:

Create a Public Variable as a String called something like: May_I_Run

Create a Variable Action called something like: Set_To_Run
Have this Action set the value of May_I_Run to "Run"

Create a Variable Action called something like: Set_To_Wait
Have this Action set the value of May_I_Run to "Wait"

Create a Job Event called something like: Set_To_Wait
Have this action Trigger on either Job Launched or Job Waiting on Resources. This Event will Select the
Action Set_To_Wait.

Create a Job Event called something like: Set_To_Run
Have this action Trigger on Job Completed Normally. This Event will Select the Action Set_To_Run.

Add the new Job Events of Set_To_Wait and Set_To_Run on your 12am, 6am, 12pm etc. job. This way, every time it starts it will change May_I_Run to "Wait". Every time it completes, it will set May_I_Run to "Run".

Add a Variable Dependency to your 5 minute interval Job where May_I_Run must equal "Run". That way, as long as it doesn't start at the exact same second as your 12am... job, the two should not be running together. You could also do this with May_I_Run as a Boolean.

Hi Cale,

 

Thanks for the reply and I apologize for delayed response as I was OOO.

Since I didn't hear anything from anyone, I had setup a Virtual Resource to manage the dependency to see if it would work.

 

I will be testing this soon once I get the systems to be available from the business.

If that does not work, I will try and implement your solution.

I will keep you posted.

 

Thanks,

Zia

Hi Cale,

I tested with Virtual Resource and it didn't work.

So, I tried your solution and it didn't work either.

Do you have any other suggestion?

 

Thanks,

I'm surprised at that -- it should have worked.  Can you tell me where it failed?  I've had good luck with these steps in the past, but if the job meant to be held is already hitting a Launched state when the job meant to hold it fires off, you'll need to adjust the timing by a minute or so.

 

Let me know where in the process it's letting you down.

Hi Cale, the solution worked after I enabled false for the first job in the job group and true for the last job.  Derrick Au gave me a hand on this.

 

Thanks for your help!