Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Monitor class updated

Table of Contents

...

Scope

  • This article describes how the substitution of parameter values works in JobScheduler. It also describes how to use parameters in shell

...

  • scripts, API Jobs and pre- and postprocessing scripts.
  • JobScheduler ships with a Monitor that performs substitution for Node Parameters:
    • The current implementation makes use of the following monitor configuration:
      • <monitor name="configuration_monitor">
            <script java_class="com.sos.jitl.jobchainnodeparameter.monitor.JobchainNodeSubstituteMonitor" language="java"/>
        </monitor>

      • The implementation became available with release 1.11:
      • Jira
        serverSOS JIRA
        columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
        serverId6dc67751-9d67-34cd-985b-194a8cdc9602
        keyJITL-276
      • Display feature availability
        StartingFromRelease1.11
    • The "classic" implementation makes use of the following configuration monitor:
      • <monitor name="configuration_monitor">
            <script java_class="sos.scheduler.managed.configuration.ConfigurationOrderMonitor" language="java"/>
        </monitor>

      • The implementation remains available throughout release 1.11 and will be discontinued with release 1.12.
        • Jira
          serverSOS JIRA
          columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
          serverId6dc67751-9d67-34cd-985b-194a8cdc9602
          keyJITL-411
        • Display feature availability
          EndingWithRelease1.12
          StartingFromRelease1.6

Substitution of parameter values by the JobScheduler

...

  • ${test} has been substituted to an empty value as this environment variable has not prevously previously been set.
  • To access the value of the parameter in a shell script, the parameter name has to be prefixed. The default value of the prefix is:
    • SCHEDULER_PARAM_
    • This prefix can be set by the scheduler.variable_name_prefix parameter which is configured in the $scheduler_data/config/scheduler.xml file. JobScheduler has to be restarted after the value of the prefix has been changed.

...

An additional substitution mechanism for jobs running in a job chain is provided by the com.sos.schedulerjitl.managedjobchainnodeparameter.configurationmonitor.ConfigurationOrderMonitorJobchainNodeSubstituteMonitor preprocessing Java class that is added as a Monitor to jobs.

...

Display feature availability
EndingWithRelease1.10

  • Performance of parameter subsitution substitution is an issue:
    • 10 node parameter: 4s
    • 20 node parameter: 6s

...

The following patterns are recognized as parameters to be substituted:

  • %param%
  • \${param}

Where param can be

  • a task parameter
  • an order parameter
  • a node parameter
  • a JobScheduler parameter
  • some special parameter (see below list)

Note: Substitution applies exclusively to the current job run. This means that the values of the parameters will be unchanged after the execution of the job. If you have an order parameter param_x whose value is value is \${param_y} and there are two steps in the job chain, the value of param_x after the execution of the first node will still be value is is \${param_y}

Handling of substitution up to release 1.10

Display feature availability
EndingWithRelease1.10

  • Parameters with the name param  and scheduler_param_param will be handled as being identical.

  • Parameters with the name param_plus_any_understrikes and paramplusanyunderstrikes will be handled as being identical.

...

Handling of substitution starting with release 1.11

...

Display feature availability
StartingFromRelease1.11

 

  • No alias parameters as up to release 1.10 are supported.
  • Jira
    serverSOS JIRA
    columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
    serverId6dc67751-9d67-34cd-985b-194a8cdc9602
    keyJITL-276

List of special parameters

NameReturn Value of API Method
SCHEDULER_HOSTspooler.hostname()
SCHEDULER_TCP_PORTspooler.tcp_port()
SCHEDULER_UDP_PORTspooler.udp_port()
SCHEDULER_IDspooler.id()
SCHEDULER_DIRECTORYspooler.directory()
SCHEDULER_CONFIGURATION_DIRECTORYspooler.configuration_directory()
SCHEDULER_JOB_CHAIN_NAMEspooler_task.order().job_chain().name()
SCHEDULER_JOB_CHAIN_TITLEspooler_task.order().job_chain().title()
SCHEDULER_ORDER_IDspooler_task.order().id()
SCHEDULER_NODE_NAMEgetCurrentNodeName(false)
SCHEDULER_NEXT_NODE_NAMEspooler_task.order().job_chain_node().next_state()
SCHEDULER_NEXT_ERROR_NODE_NAMEspooler_task.order().job_chain_node().error_state()
SCHEDULER_JOB_NAMEthis.getJobName()
SCHEDULER_JOB_FOLDERthis.getJobName()
SCHEDULER_JOB_PATHthis.getJobFolder() + / + this.getJobName()
SCHEDULER_JOB_TITLEthis.getJobTitle()
SCHEDULER_TASK_IDspooler_task.id()
SCHEDULER_SUPERVISOR_HOSTremoteConfigurationService.hostname()
SCHEDULER_SUPERVISOR_PORTremoteConfigurationService.tcp_port()

References

Product Knowledge Base

Change Management References - Agent Usage

...