We have a requirement that if a Job doesn't finish running after X amount of time, then we should force complete the Job to allow for it's successors to begin running.
I have tried to setup a test for this like the workflow presented below.
1. Create e new application with 2 jobs. The first job is a Unix job that sleeps for 2 minutes. The second job is a Unix job that runs an echo command.
2. In the Unix sleep job, I set a Time Dependency to be marked as Overdue if execution time exceeds 1 minute.
3. In the Job Notifications, I setup an Alert to monitor OVERDUE states
4. The OVERDUE Alert condition will trigger a Javascript to run that I thought would force complete the Job.
if (WOB._qualifier == null)
{
execCommand('%WOB._name', '%(APPL._name).%APPL._gen', 'ACTION COMPLETE');
}
else
{
execCommand('%(WOB._name).%WOB._qualifier', '%(APPL._name).%APPL._gen', 'ACTION COMPLETE');
}
When I trigger the Application to run, at 1 minute I see the Unix Sleep job is marked as Overdue, but the Sleep Job continues to run in EXEC state until it finishes sleeping at 2 minutes.
Any ideas on what I could be missing here to force this job to stop executing and complete after 1 minute?