HCL Workload Automation, Version 9.4

Scenario: Alternative operating system requirements

In this scenario, a definition is created for a job that can run on either a Linux or an AIX® computer.

About this task

The job can run on Linux operating systems with a minimum of 512 MB of RAM or on AIX operating systems with a minimum of 1024 MB of RAM. The job definition must include a resource requirement that specifies the two alternative requirements.

To create job definition for this job, perform the following steps:

Procedure

  1. In the Job Brokering Definition Console select File > New > Job brokering definition and create a new job definition named jobWithRequirementsByOS. The job definition opens at the Overview page with the job name assigned.
  2. Open the Application page and define the required information for the application that the job is to run.
  3. Open the Related Resources page.
  4. In the Resource Requirements pane, click Add then specify a meaningful value for the ID field. In this example it is OperatingSystemType.
  5. In the Resource Properties pane, define the logic that describes the two alternative operating system requirements, as follows:
    1. Click Add OR Operand to indicate that you are defining alternatives.
    2. Highlight the OR operand and click Add AND Operand to indicate that the alternative includes more than requirement.
    3. Highlight the AND operand and click Add Requirement.
    4. In the Resource Property Details dialog, select Operating System Type from the Property Name menu and type LINUX in the Property value field.
    5. Highlight the AND operand again and click Add Requirement.
    6. In the Resource Property Details dialog, select Total Physical Memory from the Property Name menu and type 512 in the Property value field.
    7. Highlight the OR operand again and click Add AND Operand to add the requirements for the second alternative.
    8. Highlight the new AND operand and click Add Requirement.
    9. In the Resource Property Details dialog, select Operating System Type from the Property Name menu and type AIX in the Property value field.
    10. Highlight the AND operand again and click Add Requirement.
    11. In the Resource Property Details dialog, select Total Physical Memory from the Property Name menu and type 1024 in the Property value field.
  6. Open the Resources page and create a relationship to the resource requirement, as follows:
    1. Select the Advanced Requirements tab.
    2. In the Relationships pane, click Add. The Relationship Details dialog box is displayed.
    3. In the Type menu, select Contains.
    4. In the Target menu, select the resource requirement OperatingSystemType and click OK.
  7. Select File > Save to save the job definition file.

Results

The JSDL file created for this scenario has the following syntax:
<jsdl:jobDefinition xmlns:jsdl="http://www.abc.com/xmlns/prod/scheduling/
    1.0/jsdl" xmlns:jsdle="http://www.abc.com/xmlns/prod/scheduling/1.0/jsdle"
    xmlns:xmi="http://www.omg.org/XMI" xmi:version="2.0" description="This job
    has different requirements for memory based on the operating system it will
    run on  " name="jobWithRequirementsByOS">
  <jsdl:application name="executable">
    <jsdle:executable path="/opt/myExecutable">
    </jsdle:executable>
  </jsdl:application>
  <jsdl:resources>
    <jsdl:relationship target="OperatingSystemType" type="Contains"/>
  </jsdl:resources>
  <jsdl:relatedResources id="OperatingSystemType" type="OperatingSystem">
    <jsdl:properties>
      <jsdl:or>
        <jsdl:and>
          <jsdl:requirement propertyName="OperatingSystemType">
            <jsdl:exact>LINUX</jsdl:exact>
          </jsdl:requirement>
          <jsdl:requirement propertyName="TotalPhysicalMemory">
            <jsdl:range>
              <jsdl:minimum>512</jsdl:minimum>
            </jsdl:range>
          </jsdl:requirement>
        </jsdl:and>
        <jsdl:and>
          <jsdl:requirement propertyName="OperatingSystemType">
            <jsdl:exact>AIX</jsdl:exact>
          </jsdl:requirement>
          <jsdl:requirement propertyName="TotalPhysicalMemory">
            <jsdl:range>
              <jsdl:minimum>1024</jsdl:minimum>
            </jsdl:range>
          </jsdl:requirement>
        </jsdl:and>
       </jsdl:or>
    </jsdl:properties>
  </jsdl:relatedResources>
</jsdl:jobDefinition>