You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Question: Can job dependencies be defined for the JobScheduler?

Answer:

Using job chains

Sequences of jobs can easily be configured in job chains that guarantee that a successor job is not invoked if a previous job provokes an error. Job errors can be configured to be detected by execution code (for executable files), signals (for Unix only), availability of output to stderr and by errors that were raised either by API methods or by SQL exceptions (and normal SQL errors).

Job chains are nodes of jobs that are organized in a sequence, every node is given a distinct state. An order proceeds along the jobs in a job chain one after the other. Should a processing error occur, then the order is stopped and removed from the job chain.
See the samples in What is the concept of "job chains and order processing"?

In addition to this you could use monitor scripts to implement more complex conditions for job starts in any of the languages Java, Javascript, Perl and VBscript. The Job Scheduler API provides a method scheduler_job.start() that can be used in scripts that implement their own business logic for conditional job starts.

Moreover this API method can be exposed to Oracle pl/sql procedures or functions (by Java classes in the database) that enable jobs to be launched in a transactional environment (e.g. start a job exlusively after commit has been invoked) either by triggers or by pl/sql procedures.

Using successor jobs

You could configure any jobs to succeed the current job based on it's execution result:

<job>
  <process file="..."> or <script language="...">
    
    <commands on_exit_code="success">
      <start_job job="ftp_get_files"><params/></start_job>
    </commands>
    
    <commands on_exit_code="error">...</commands>
    
    <commands on_exit_code="1 2 4 8">...</commands>
  </process>
</job>

You could configure any job to start arbitrary successor jobs and orders from Job Scheduler release 1.2.7 onwards.

  • No labels