Scope
- By use of Scripting the last execution date of a job can be retrieved from the job history.
- Such information can be exposed as job parameter to the current job.
- FEATURE AVAILABILITY STARTING FROM RELEASE 1.10.1
Scripting
- Scripting can be added by use of Pre- and Postprocessing Scripts.
- Each job can be assigned a number of Pre- and Postprocessing scripts that are executed in the configured sequence.
- The scripts can include
- Java classes
- JavaScript code
- Scripted conditions are a powerful means for flexibility:
- The JobScheduler exposes its objects, methods and properties by use of the API Interface.
- Find details and examples with the Reference Documentation.
- Scripted conditions can be applied by implementing a
spooler_process_before()
function for a preprocessor monitor with jobs in a job chain that will- return the value
true
if the job should start, - return the value
false
if the job should not start.
- return the value
Example
- Download: last_execution.zip
- Extract the archive to the hot folder in your JobScheduler installation
./config/live
. - The archive will extract the files to a sub-folder
last_execution.
- Extract the archive to the hot folder in your JobScheduler installation
The example retrieves the last execution date of the current job and adds this information as a job parameter:
The example makes use of
a pre-processing Monitor to retrieve the last execution date.
the Monitor makes use of the Job History to retrieve the execution date.
- Some Java date calculation is added to convert dates to an ISO 8601 format. This can be adjusted as desired.
a Windows shell job that simple outputs the parameters that have previously been added:
the same job would be used for Unix environments like this:
See also
- How to check the job history for previous job runs
- How to add conditions for job execution with date calculation