...
Status colour Yellow title Redo screenshots
This example shows how job chain node parameters can be defined in the an order configuration and assigned to a specific job chain nodes.
In addition, the example shows how these parameters can be called in shell jobs and used together with 'standard' job and order parameters.
Example Download
- You can download a sample from the example here.
...
Syntax for specifying job chain node parameters in orders
- The syntax for order parameters that are specific to a job chain node is <node>/<name>.
(This is in contrast to the 'standard' order parameter syntax of <name>.)
Note
- A
...
- job chain node parameter will be overwritten by an order node parameter with the same name
...
- .
- Order node parameters can be used if job chain node parameters
- Substitution will be done for the order node parameter.
- A job chain node parameter with the same name will be overwritten by the order node parameter.
- Order node parameters can be used if job chain node parameters have not been defined and a job chain configuration file has not been created.
Example Job Chain configuration
The following screenshot shows the example Here is the job chain with two nodes :
The order defines the parameters for the job chain node.
...
and the same job specified for each node:
The next screen shot shows the parameters defined for the order.
The first two entries in the parameter tab form show the values for the orderNodeParameter defined for the each of the nodes in the job chain:
- at the node 100 the orderNodeParam will have the value 100
- at node 200 the orderNodeParam will have the value 200 together with the values of two other parameters:
- jobParam - a job parameter specified for the job1 and
- orderParam - an order parameter which is specified in the next line of the form
The third entry in the form shows the 'standard' order parameter orderParam.
The next screenshot shows the jobParam parameter which retains its value every time the job is run.
The example has a very simple shell script that gives out the value of the orderNodeParam job chain node parameter .
As can be seen in the screenshot below the parameter name is prefixed with the default JobScheduler environment variable prefix SCHEDULER_PARAM_
.
Note that on Unix systems the required syntax would be $SCHEDULER_PARAM_ORDERNODEPARAM
.
A pre-/post-processing configuration monitor with a Java class has to be specified for the job before the jobParam and orderParam parameters can be used in the job chain node parameters in the shell script. The configuration monitor is shown in the next screenshot:
As already described above, the values of the jobParam and orderParam parameters are substituted into the orderNodeParameter at the 200 node of the job chain.
Running the example
Start the order1 using Order Menu / Start order now as shown in the screenshot:
At step 100 the job1 shell script will give out the value for the orderNodeParam defined in the order in the log file:
Code Block | ||
---|---|---|
| ||
[stdout] job1: Value of orderNodeParam = 100 |
At step 200 the shell script will give out the value for the orderNodeParam defined in the order in the log file (200) together with the values set for the orderParam and jobParam:
Code Block | ||
---|---|---|
| ||
[stdout] job1: Value of orderNodeParam = 200 Parameter-value-from-job - Parameter-value-from-order |
Use with API Jobs
At the time of writing (current releases are 1.8.4, 1.9.8 and 1.10.2) the above example works with shell jobs and not with API jobs - which includes many of the JITL jobs.
A fix for this issue is planned An issue has been raised - for more information see Jira server SOS JIRA columns key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution serverId 6dc67751-9d67-34cd-985b-194a8cdc9602 key JS-1573
...
Code Block | ||
---|---|---|
| ||
<job stop_on_error="no" order="yes" name="job2job1"> .... <monitor name="configuration_monitor" ordering="0"> <script language="java" java_class_path="" java_class="sos.scheduler.managed.configuration.ConfigurationOrderMonitor"/> </monitor> /job> |
...
Example showing job chain node parameters defined for the job chain
...
The screenshot below shows the monitor configuration in JOE.
The XML code generated by JOE for the readparam.job is:
...
The following screen-shot shows the job chain node parameters for the example:
The next screen-shot shows the Details for JobChain form, which can be used to edit the param1 and param2 parameters. This form is opened with the Parameter button shown in the previous screenshot (top right):
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.)
...