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

Compare with Current View Page History

« Previous Version 6 Current »

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 return code (for executable files), signals (for Unix only), availability of output to stderr and by errors that are 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 job nodes in a job chain one after the other. Should a processing error occur, then the order can be configured to stop, to repeat (setback) or to be removed from the job chain.

In addition to this you could use Monitor scripts to implement more complex conditions for job starts in any of the languages Java and Javascript. The Job Scheduler API provides methods 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 e.g. 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>

See also

 

 

  • No labels