Autosys job kick off process - jobs

I have an auto sys job named JOB2 which has a dependencies on JOB1.
So the condition mentioned in the job definition for JOB2 will be as below
date_condition:0
condition: s( JOB1)
These two jobs are not in any box, these are two independent jobs.
So my question is when my JOB1 gets into success condition will my JOB2 get kicked off (i.e start automatically)
If so please explain the flow in auto sys?

A job in Autosys either starts as per schedule ( based on date_condition: and start_time: attributes) or is force started ( manually sendevent to force start)
Considering, JOB1 and JOB2 independent jobs, and JOB2 dependent on JOB1, if JOB2 starts as per schedule, it will stay in AC state until JOB1 is SU, once JOB1 is SU , JOB2 will start automatically. But if you force start JOB2 , it run to completion/failure irrespective of its conditions and status of JOB1.

Related

JBPM 7.31, automatically skip human task after due date

in JBPM is it possible to automatically skip a human task after the due date?
This is an example of my process
In task 'Evaluation' the user can ask for a Contribution, in this case the next task will be 'Contribution'.
The task 'Contribution' has a sla of 2 day.
After this period the process must automatically return to task 'Evaluation'.
Is this possible?
Thanks
Try using TimerBoundaryEvent for Contribution task. Define 2 day sla at TimerBoundaryEvent if UserTask is not completed in 2 days, task will be cancelled and process flow can continue to Gateway or other tasks.

Is it possible to prevent SQL Agent Job from running if related job or previous instance has not finished?

I have three SQL Agent jobs, one for each of three registries being managed. These go off on a staggered schedule every two hours (i.e. Reg 1 at 9am, 3pm; Reg 2 at 11am, 5pm; Reg 3 at 1pm, 7pm).
In most every circumstance, it takes less than two hours for one of these jobs to run. However, if it is taking longer than expected, I do NOT want the other job to run. So, if Reg 1's 9am run is taking more than 2 hours, I do not want Reg 2's 11am job to run UNTIL Reg 1's job is completed.
How can I work this conditional run functionality in? I am not seeing anything in the schedules properties of the job. Let me know if you need more clarification!
Thanks!!

Setting an Individual Hangfire Job to Have Longer Auto Retry timeout Value

I know Hangfire has a logic of auto re-queue jobs that have been running for >30 minutes.
But I have a job that will run for >30 minutes and I don't want any auto-retry.
Meanwhile, I have some jobs that need auto-retry.
Is there anything to configure an individual job's auto-retry-timeout value?
e.g. I manually configure job A's value to 24 hours so it can run for 24 hours without any timeout retry while other jobs remain the same and are auto re-queued when their execution time exceeded 30 minutes.

Background Threads in Horizontally Scaled Application

The current situation is that I have an application that scales horizontally with one SQL database. Periodically, a background process is ran but I only want one invocation of this background process running at a time. I have tried to accomplish this by using a database row and locking but I am stuck. The requirement is that only one batch job should have successfully completed per day.
Currently I have a table called lock which has three columns: timestamp, lock_id, status. Status is an enum that has three values 0 = not running, 1 = running, 2 = completed.
The issue is that if a batch job fails and status is equal to 0, How can I make sure that only one background process will retry. How do I guarantee that only one background process is running in the retry scenario?
In an ideal world, I would like to do a SELECT statement that checks for the STATUS in the locking table, if status is = 0 meaning not running then start the background job and change status to 1 = running. However, if all horizontally scaled processes do this at the same time, is it guaranteed that only one is executed?
Thanks!

How to pass current time to recurring Hangfire job?

I have a recurring Hangfire job that runs daily. As part of the logic the job fetches entities created within the last 24 hours. It uses DateTime.Now in the logic. I realize that this is not a robust design in the case that the job fails and it is run several days later. Is there any way I can pass the current time as a parameter to a recurring job? Or do I need to rewrite the logic to be independent of the current time? I have tried RecurringJob.AddOrUpdate(() => FooAction.Execute(GetTime()), cronSchedule); but as expected that just always passses the time that the recurring job was created.
One idea would be to skip the recurring job and create a regular Hangfire job instead. The last thing the job should do is create a new job and pass the specified time as parameter. But I would prefer to use a recurring job if I can.
"You could have a recurring job run that is responsible for creating non-recurring jobs, and passing the current time into those."
From comment by #mason.