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 from the current date and time.
  • the updated Job Resource will be automatically deployed and will be available to related Agents.
  • any workflow assigned the Job Resource have access to the updated variable.

FEATURE AVAILABILITY STARTING FROM RELEASE 2.5.2

Encyption capabilities are available:

FEATURE AVAILABILITY STARTING FROM RELEASE 2.7.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 and com.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

Users can invoke 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 Controller is the one that is currently selected by the user.
  • Select the check box provided with each argument if you want this argument to be added to the arguments of the SetJobResourceJob 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

Arguments

The SetJobResourceJob class accepts the following arguments:


NameRequiredDefault ValuePurposeExample
job_resourceyes
The path to the Job Resource that should be created or updated. Both specification of a path and specification of the name for the Job Resource can be used./resources/my_vars

key

yes

The name of the variable in the Job Resource (case-sensitive).

var1
value

yes

(one of file or value is required)


The value of the variable:

  • The value allows strings, numbers etc.
  • A special syntax is supported for date values: [<java-date-pattern>]
    • for example [dd/MM/yyyy], [yyyy-MM-dd], [yyyy-MM-dd hh:mm:ss], [yyyy-MM-dd hh:mm:ssZ]
    • The Java date pattern will be replaced by the current date and time.. 

file

yes

(one of file or value is required)


The name of a file:

The content of the file will be used as the value of the Job Resource variable. The content is stored using the to_file() function. Additionally the variable key_<nameOfKey> is added where <nameOfKey> is the value of the key argument. The key_<nameOfKey> variable will be stored holding the encrypted symmetric key, initialization vector and path to encrypted file separated by spaces. The encrypted file is a temporary file created during encryption. The values are required for decryption:

  • The encrypted symmetric key is decrypted using the Private Key
  • The encrypted file is decrypted using the decrypted symmetric key and initialization vector.
  • The path to the file can be used in subsequent processing.

time_zoneno

If a Java date pattern is specified for the value argument, then the date is calculated for the given time zone.

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 the argument is omitted then the time zone that the Agent is operated for will be used.


environment_variableno

The name of an environment variable in the Job Resource that should automatically be populated with the value specified for the key argument. Technically the environment variable will hold a reference to the key.


controller_idno
The Controller ID identifies the Controller to which the updated Job Resource will be deployed.
encipherment_certificateno

The CA signed or self-signed X.509 certificate used for encryption. Alternatively the Public Key can be specified. This variable is frequently provided from a Job Resource that is managed with the Certificate Management page in JOC Cockpit. When this variable is set, the value or file will be encrypted. The encrypted value will contain:

  • encrypted symmetric key which can be decrypted using the Private Key
  • encrypted file which can be decrypted using the decrypted symmetric key and the initialization vector.
  • path to the file which can be used in subsequent processing.

If a certificate is specified, the value or file will be encrypted and will be added the Job Resource.


Resources


  • No labels