Job gets triggered twice
search cancel

Job gets triggered twice

book

Article ID: 97708

calendar_today

Updated On:

Products

CA Workload Automation AE - Business Agents (AutoSys) CA Workload Automation AE - Scheduler (AutoSys) Workload Automation Agent

Issue/Introduction



Job which has multiple conditions is running whenever any of the dependent jobs complete rather than waiting until all the dependencies are re-run to success.

Sample JIL:
insert_job: job1
job_type: BOX 
condition: s(job2) & s(job3) 

 

Environment

Product - Workload Automation AE 11.3.x, 12.x
Platform - ANY
Database - ANY
 

Resolution

insert_job: job1
job_type: BOX 
condition: s(job2) & s(job3) 

Given the above job definition it would be expected for job1 to run any time both job2 and job3 are in a success state.

Example.
Newly insert all three jobs.
The initial status is inactive.
Run job2 to success.
When it completes AE checks job1's conditions to see if it can start yet.
It cannot as job3 is still inactive.
Run job3 to success.
When it completes AE checks job1's conditions to see if it can start yet.
It can as both job2 and job3 are in success status.
Job1 runs to success.
Now run job2 to success again.
When it completes AE checks job1's conditions to see if it can start yet.
It can as again both job2 and job3 are in SU state.

If the desired behavior is to have job1 wait until both job2 and job3 run again then consider using the look-back option.

insert_job: job1
job_type: BOX 
condition: s(job2,0) & s(job3,0)

The ,0 tells AE that the job must have run to success since the last time job1 ran to completion.

Example:
Newly insert all three jobs.
The initial status is inactive.
Run job2 to success.
When it completes AE checks job1's conditions to see if it can start yet.
It cannot as job3 is still inactive.
Run job3 to success.
When it completes AE checks job1's conditions to see if it can start yet.
It can as both job2 and job3 are in success status.
Job1 runs to success.
Run job2 to success again.
When it completes AE checks job1's conditions to see if it can start yet.
It cannot, while job2 has run to success since the last time job1 ran, job3 has not.
AE must wait for job3 to run to success again.
Run job3 to success.
When it completes AE checks job1's conditions to see if it can start yet.
It can as again both job2 and job3 have run to success since the last time job1 ran.

 

Additional Information

https://docops.ca.com/ca-workload-automation-ae/11-4-2/en/reference/ae-job-information-language/jil-job-definitions/condition-attribute-define-starting-conditions-for-a-job#conditionAttribute--DefineStartingConditionsforaJob-Look-BackDependencies