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

Powershell jobs in shell mode - accessing environment variables of the job chain node parameters

    XMLWordPrintable

Details

    • Feature
    • Status: Released (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.12, 1.13
    • 1.12.15, 1.13.10
    • None
    • None

    Description

      Current Situation

      • Parameters can be specified for job chain nodes by using the parameter name syntax: <state>/<param> where
        • <state> is the state of the job chain that the parameter refers to
        • <param> is the name of the parameter
      • Parameter passing by environment variables is only available for PowerShell jobs that do not implement any of the API functions spooler_init(), spooler_exit(), spooler_process() etc.
        • The Powershell interface provides the environment variables for all task/order parameters based on the configured parameter names.
        • The same behaviour is used to set the environment variables from the job chain node order parameters
          • Exampe order definition
            <order priority="0" state="powershell_job">
                <params>
                        <param name="powershell_job/TASK_NAME" value="Powershell test job"/> <!-- job chain state/param parameter -->
                        <param name="test" value="test param value"/>
                 </params>
                 <run_time/>
             </order>
            
            • The Powershell Interface will create 2 environment variables:
              • SCHEDULER_PARAM_POWERSHELL_JOB/TASK_NAME = Powershell test job
              • SCHEDULER_PARAM_TEST = test param value

      Desired Behavior

      • The PowerShell jobs in shell mode should create the environment variables of the job chain node order parameters without state information.
        • Example: SCHEDULER_PARAM_TASK_NAME instead of SCHEDULER_PARAM_POWERSHELL_JOB/TASK_NAME

      How to Reproduce

      • Unzip the attached configuration to the ./live folder.
      • Login to the JOC Cockpit
      • Switch to the Configuration view
      • Start the order for the PowerShell job chain.
      • The output will be an empty string as the PowerShell job is not able to read the node parameters which are added to the order in the form, e.g. powershell_job/TASK_NAME.

      Attachments

        Activity

          People

            re Robert Ehrlich
            divyani-rathore Divyani Rathore
            Divyani Rathore Divyani Rathore
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: