Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

At every change of status in job chains Job Scheduler parses a temporary file for "namh1. value" pairs. The "namevalue" pairs will be set as order params. The name of the temporary file is availabe with the environment variable SCHEDULER_RETURN_VALUES. See Passing_parameters_from_shell-jobs_to_JS also for a sample to pass parameters to pure shell jobs.

The sample below describes a job chain with two steps. Both are running the generic job PowerShellExecutor to execute a powershell script within JobScheduler.

...

Code Block
 "job-node parameter from the previous step:"
 "myParam=$env:SCHEDULER_PARAM_myParam"
 exit $lastexitcode
 # to change the policy for using powershell you can use this .adm file:
 #    http://www.microsoft.com/download/en/confirmation.aspx?id=25119

Job Chain

Image Added

the xml representation of the job_chain:

Code Block
 <job_chain>
    <job_chain_node state="100" job="PowerShellExecutor" next_state="150" error_state="error"/>
    <job_chain_node state="150" job="PowerShellExecutor" next_state="200" error_state="error"/>
    <job_chain_node state="success"/>
    <job_chain_node state="error"/>
 </job_chain>

The parameters for the job chain nodes are defined in a separated configuration file. Click the parameter button shown in the image above to specify the parameters for the selected job chain node.

the parameter for the first step:

Image Added

the parameter for the second step:

Image Added

the xml representation of the configuration file:

Code Block
  <settings>
      <job_chain name="powershell_with_parameter">
          <note language="de"/>
          <note language="en"/>
          <order>
              <params/>
              <process state="100">
                  <note language="de"/>
                  <note language="en"/>
                  <params>
                      <param name="Script_Filename"
                             value="$\{SCHEDULER_DATA\}\config\live\samples\90_powerShell\powershell_with_parameter_set.ps1"/>
                      <note language="de">
                          <div xmlns="http://www.w3.org/1999/xhtml"/>
                      </note>
                      <note language="en"/>
                  </params>
              </process>
              <process state="150">
                  <note language="de"/>
                  <note language="en"/>
                  <params>
                      <param name="Script_Filename"
                             value="$\{SCHEDULER_DATA\}\config\live\samples\90_powerShell\powershell_with_parameter_get.ps1"/>
                      <note language="de">
                          <div xmlns="http://www.w3.org/1999/xhtml"/>
                      </note>
                      <note language="en"/>
                  </params>
              </process>
          </order>
      </job_chain>
  </settings>

...

see also:

...