Introduction
The JITL SetJobResourceJob template can be used to populate the JS7 inventory from JS7 - Job Resources
- to add or update a variable in a Job Resource,
- to deploy a Job Resource.
The JITL SetJobResourceJob template can be used for example to set a variable holding a business date:
- the variable in the Job Resource can be updated with the current date and time.
- the updated Job Resource is automatically deployed and becomes available to related Agents.
- any workflow that is assigned the Job Resource has access to the updated variable.
FEATURE AVAILABILITY STARTING FROM RELEASE 2.5.2
Usage
When defining the job either:
- invoke the Wizard that is available from the Job Properties tab in the Configuration view and select the JITL SetJobResourceJob template and relevant arguments from the Wizard
or
- specify the
JITL
job class andcom.sos.jitl.jobs.inventory.SetJobResourceJob
Java class name and add arguments specifying the Job Resource and variable to be added or updated.
Example
Download (upload .json): setResourceJob.workflow.json
You can use the job wizard like this:
Explanation:
- Add an empty job from the instruction panel.
- Specify a name and a label for the job.
- Select an Agent.
In a next step invoke the job wizard that you find in the upper right corner of the job property editor. The wizard brings up the following popup window:
Explanation:
- From the list of available job templates select the SetJobResourceJob.
Then hit the "Next" button to make the job wizard display available arguments:
Explanation:
- There are optional arguments for this job to identify the controller to which the Job Resource should be deployed:
- The default is the controller that is actually selected by the user that performs the login
- Select the check box provided with each argument if you want this argument to be added to the arguments of the SetJobResource template.
When hitting the Submit button the wizard adds the required arguments to the job which should look like this:
Documentation
The Job Documentation including the full list of arguments can be found under: https://www.sos-berlin.com/doc/JS7-JITL/SetJobResourceJob.xml
The SetJobResourceJob class accepts the following arguments:
Name | Required | Default Value | Purpose | Example |
---|---|---|---|---|
job_resource | yes | The path to the Job Resource that should be created or updated. Both specification of a path and specification of the name can be used. | /resources/my_vars | |
| yes | The name of the variable in the Job Resource (case-sensitive). | var1 | |
value | yes | The value of the variable:
| ||
time_zone | no | If a Java data pattern is specified for the The time zone is specified from a string, for example "GMT", "Europe/London". Valid time zone strings as explained with https://en.wikipedia.org/wiki/List_of_tz_database_time_zones can be specified. If this parameter is omitted then the time zone that the Agent is operated for will be used. | ||
environment_variable | no | The name of an environment variable in the Job Resource that should automatically be populated with the value specified for the | ||
controller_id | no | The Controller ID identifies the Controller to which the updated Job Resource will be deployed. |
Further Resources
- JS7 - JITL Common Variables
- JS7 - How to make a global Business Date variable available to jobs
- JS7 - How to update a Job Resource using the REST Web Service API from the Shell