Uploaded image for project: 'JS - JobScheduler'
  1. JS - JobScheduler
  2. JS-606

Typ of Assignment Order Parameter to Script Environment Variables can be customized (Job specific order parameter)

    XMLWordPrintable

Details

    Description

      JobScheduler Parameters

      The following parameter can be used to configure the JobScheduler:

      SCHEDULER_VARIABLE_NAME_PREFIX

      This prefix can be used to specify the names used to declare job and order parameters in shell jobs. These names are made up from this prefix and the relevant job and order environment variables.
      The JobScheduler will use SCHEDULER_PARAM_ if the SCHEDULER_VARIABLE_NAME_PREFIX parameter is not specified.
      If the SCHEDULER_VARIABLE_NAME_PREFIX is set to *NONE, the environment variable(s) will be used without a prefix.
      This parameter is particularly useful, when already existing shell scripts are to be controlled by the JobScheduler.
      It is possible to configure the JobScheduler so that job or order parameters can be directly used in shell scripts when

       
      <params>
        <param name="SCHEDULER_VARIABLE_NAME_PREFIX" value="*NONE" />
      </params>
      

      is specified in the ./config/scheduler.xml central configuration file.

      CAREFUL!
      Setting this parameter - in particular setting it to *NONE - can lead to conflicts with existing environment variables such as PATH. It should therefore be used carefully.

      CAREFUL!
      It is not possible to use SCHEDULER_VARIABLE_NAME_PREFIX if your working with agents before version 1.3.12.2068.

      JobScheduler parameters can be called using the spooler.variables() method.

      Example (Windows):

      In this example the MYPREFIX_ prefix is specified in the ./config/scheduler.xml file:

      <params>
        <param name="SCHEDULER_VARIABLE_NAME_PREFIX" value="MYPREFIX_" />
      </params>
      

      and the following order is used to start the sample job (via a job chain) and hand over the ORDER_PARAM parameter:

      <order job_chain="job_chain_windows" id="1">
        <params>
          <param name="ORDER_PARAM" value="ORDER_PARAM"/>
        </params>
        <run_time let_run="yes"/>
      </order>
      

      The sample job is a shell job that uses the order parameter as well as providing an additional parameter (JOB_PARAM) for the shell script. It is important that the parameters forwarded by the order and the job are addressed using the prefix MYPREFIX_.

      <job order="yes" stop_on_error="no">
        <params>
          <param name="JOB_PARAM" value="JOB_PARAM" />
        </params>
        <script language="shell">
                  
          echo ORDER_PARAM=%MYPREFIX_ORDER_PARAM%
          echo JOB_PARAM=%MYPREFIX_JOB_PARAM%
                  
        </script>
      </job>
      

      $MYPREFIX_ORDER_PARAM and $MYPREFIX_JOB_PARAM are used on Unix systems.

      Attachments

        Activity

          People

            ss Stefan Schädlich (Inactive)
            ss Stefan Schädlich (Inactive)
            Oliver Haufe Oliver Haufe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: