Dependencies
- JobScheduler can handle dependencies at job chain, job and order level:
- Pre-processing can be defined at job level to check if required resources are available.
- Pre-processing can also be used to set environment variables and to communicate with other JobScheduler instances etc.
- Examples would be to check if records in a database were available, if a previous job produced some required output etc.
- Post-processing can be used to check if the processing was successful, if required results are produced or to decide on the next processing step,
- Examples would be to check if the total records in a database were are more than 1 Million, then to start a database re-index job and else to skip that job.
- Pre-processing can be defined at job level to check if required resources are available.
- JobScheduler provides a JITL Job CheckRunHistory to check if a particular job was executed successfully during a given period, e.g. during the last 24 hours.
- This example job chain has a first node as CheckRunHistory to check if JobA1 was successfully executed in the last 24 hours.
- In this example the job chain will abort and will end in an error state, however, as per requirement more complex scenarios can be configured, e.g.
- wait for 2 hours,
- send an alert or
- start another job.
- By using JobScheduler configuration and its internal API more possible dependencies can be checked.
- See JITL job documentation for more information JobSchedulerCheckRunHistory.xml.
Diagram of Job Chain
Job CheckRunHistory
<?xml version="1.0" encoding="ISO-8859-1"?> <job title="Checks the last job run" order="yes"> <params > <param name="JobName" value="Demo/Scenario03/JobA1"/> <param name="start_time" value="-1"/> <param name="message" value="The Job 1. ${JOB_NAME} 2. [JOB_NAME] was not running successfully today until 15:00h "/> <param name="query" value="isCompletedBefore "/> </params> <script language="java" java_class="sos.scheduler.CheckRunHistory.JobSchedulerCheckRunHistoryJSAdapterClass"/> <run_time /> </job>