Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: 'Using P. in Shell Script Jobs' added

...

A parameter set here will overwrite a parameter with the same name that has been configured for a job.

...

Using Parameters in Shell

...

Script Jobs

...

  • as environment variables to shell scripts.
  • Environment variables are named using a predefined prefix and the name of the original parameter: 
    • The default value for the environment variable prefix is SCHEDULER_PARAM_ 
    • Environment variable names are provided with uppercase letters.
    • For example, a parameter param1 can be accessed by the SCHEDULER_PARAM_PARAM1 environment variable.
    • For details see Which environment variables are provided by JobScheduler?

Examples for parameters defined for a job

The following two examples show a job parameter defined in a job <param> tag can be used in a shell script.

Code Block
languagexml
titleExample for Windows showing how a task parameter can be used in a shell script
collapsetrue
 <job>
    <params>
        <param name="param1"  value="Test"/>
    </params>
    <script language="shell">
        <![CDATA[
 rem This is an example shell script to show the use of parameters
 echo Param1 has the value %SCHEDULER_PARAM_PARAM1%
        ]]>
    </script>
    <run_time/>
 </job>
Code Block
languagexml
titleExample for Unix showing how a task parameter can be used in a shell script
collapsetrue
 <job>
    <params>
        <param name="param1" value="Test"/>
    </params>
    <script language="shell">
        <![CDATA[
 # This is an example shell script to show the use of parameters
 echo "Parameter param1 has the value $SCHEDULER_PARAM_PARAM1"
        ]]>
    </script>
    <run_time/>
 </job

Examples for parameters defined on job start

The following example shows an XML command to start a job with parameters.

Code Block
languagexml
titleExample for Windows showing how a task parameter can be used in a shell script
collapsetrue
 <start_job job="my_job">
    <params>
        <param name="param1"  value="Test"/>
    </params>
 </start_job>
  • A parameterized job start can be used programmatically, e.g. by use of the JobScheduler start script.
  • Such parameterized job starts can be effected by JOC.

For further information see

...

...

Using Parameters in API Jobs

API jobs ..Job and order parameters are exposed to the API as objects.

This is described in detail in:

...