Table of Contents
Introduction
This example configures a job chain with jobs that use a special monitor to read parameters from job chain parameter files. The parameters in these files can reference other (global) parameters.
Downloads
- job_chain_node_params.zip - configuration files
Instructions
- Unzip all files into the
./config
folder of your JobScheduler installation. Open
config/scheduler.xml
and add the following lines right before the<security>
element:Code Block <params> <param name="global_configuration_params" value="config/scheduler_global_vars.xml"/> </params>
...
Nothing special so far. The next section explains how these resulting parameters were configured.
How it works
The job chain chain_a
consists of two steps, "first" and "second". Both steps use the same job readparam
. The readparam
job is a small JavaScript job which reads all order parameters and logs them on info
-level.
The Java monitor implementation
The sos.scheduler.managed.configuration.ConfigurationOrderMonitor
is configured as a monitor for the job. This is a special pre/post-execution script which is included in the JobScheduler distribution. It can be used for all jobs.
...
Note that the node parameters - param3 and param4 are set and edited using JOE's XML editor, which is accessed using the OpenXML button shown in the screenshot.
(See also the Example in Detail section below.)
The example in detail:
When using hot folders, the configuration monitor looks for the job chain parameter file in the current hot folder and expects the name job_chain_name.config.xml. So in this case, the name of the job chain parameter file is chain_a.config.xml
.
...
- The second
<params>
element is a child of<process state="second">
. It configures parameters for the second node (called "second") of the job chain. It overwrites theparam2
parameter and sets it toxyz
.param3
is not set at all, thus it doesn't appear in the log for statesecond
. param4
is defined in the same way as in statefirst
, but this time the resulting value is different becauseparam2
has been overwritten for this state.
Usage Notes
This flexible use of parameters cannot be achieved using normal order parameters. It could be achieved by using job parameters, but if the same job is used at multiple steps in a job chain or in different job chains you would have to define multiple instances of that job, although it is the same job implementation.
...
In the current example we use the same job twice, but as you have seen from the log, with different parameters.
Scope / Application
In job chain parameter files the ${PARAMNAME}
-syntax can be used to reference:
- order parameters
- order parameters defined in the job chain parameter file
- global JobScheduler variables
- environment variables
Further References
Job Chain and Job Chain Node Parameters
Content by Label | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...