Table of Contents
Introduction
This article show how you can make a job retry in event of errors and control this behavior.
Downloads
Required Version:
You will require JobScheduler Version 1.8 or newer to be able to run the example configuration files.
Download the file:
- setback.zip - configuration files
Instructions
- Unzip all files into the
./config/live
folder of your JobScheduler installation. - Open the JobScheduler Operating Center, JOC, in your browser using http://scheduler_host:scheduler_port
- Open the JOB CHAINS tab and enable Show orders.
- Find the job chain
samples/setback/chain_setback
. - Find the order
order1
, click on the order to open the order pane and choose "Show log" in the order menu.
...
On the third try, a successful completion of the job is simulated (representing, for example, that the network connection is working again). The order will then continue into the second job of the job chain.
How it works
The order has an initial order parameter count
which is set to 1. The first job (setback) reads this parameter. If the parameter is not 3, it is increased and the job calls the order's setback()
function (which is what a job should do in case of errors that might be temporary).
...
When the count
parameter of the order has reached 3, success is simulated. The job does not setback the order this time and the order is able to run through the following jobs.
Sebacks in JOE
The JobScheduler's Object Editor, JOE provides a SetBack Form for the configuration of job setbacks. This form, together with the configuration listed in the code block above, is shown in the following screen shot:
...