Adding New Job and Task Properties

Applies To: Windows Compute Cluster Server 2003

The standard job and task options (referred to as job terms and task terms) in Windows Compute Cluster Server 2003 can be extended by adding new terms to the job template XML file, then submitting the job using the edited template. The job and task terms are then captured when the job is submitted and can be utilized by user-written job submission or job activation filters. (See Adding Job Submission and Activation Filters.) Job Scheduler itself ignores the extended terms.

To add an extended job or task term

  1. Create the job by clicking File then Submit Job… in Job Manager. (See Create a Job.)

  2. When you are finished defining the job, click Save As Template.

  3. In your template directory (usually %userprofile%\My Documents), open the saved job file for edit.

  4. Add the extended job or task term as shown the example job file below.

  5. Save the file.

  6. To submit the job, open the file in Job Manager by clicking File then Submit Job with Template…, then click Submit.

To submit the job using the template file from the command-line interface, enter:

Job submit /jobfile:<template_file>

Example: an edited job template file

An example job template file with extended job and task terms is shown below. Note the following rules:

  1. The new term is always defined in block like this:

    - <ExtendedTerms>
    - <Term>
      <Name>term1</Name>
      <Value>value1</Value>
      </Term>
      </ExtendedTerms>
    
  2. A block defining an extended term must be placed within the Job block of the job file if it is a job term and within the appropriate Task block of the job file if it is a task term. A job file consists of:

    • A Job block consisting of <Job…> and </Job> and everything in between.

    • A Tasks blocks consisting of <Tasks…> and </Tasks> and everything in between

    • One or more Task blocks consisting of <Task ID… > and </Task> and everything in between

  <?xml version="1.0" encoding="utf-8" ?>
- <Job xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema" Name="job2" MinimumNumberOfProcessors="2" MaximumNumberOfProcessors="2" IsExclusive="false">
- <ExtendedTerms xmlns="https://www.microsoft.com/ComputeCluster/">
- <Term>
  <Name>Var1</Name>
  <Value>1000</Value>
  </Term>
  </ExtendedTerms>
- <Tasks xmlns="https://www.microsoft.com/ComputeCluster/">
- <Task Id="1" Name="task1" CommandLine="notepad.exe" IsExclusive="false">
- <EnvironmentVariables>
- <Variable>
  <Name>Envar2</Name>
  <Value>Val2</Value>
  </Variable>
  </EnvironmentVariables>
- <ExtendedTerms>
- <Term>
  <Name>term1</Name>
  <Value>value1</Value>
  </Term>
  </ExtendedTerms>
  </Task>
- <Task Id="1" Name="task2" CommandLine="notepad.exe" IsExclusive="false">
- <EnvironmentVariables>
- <Variable>
  <Name>Envar2</Name>
  <Value>Val2</Value>
  </Variable>
  </EnvironmentVariables>
- <ExtendedTerms>
- <Term>
  <Name>term1</Name>
  <Value>value1</Value>
  </Term>
  </ExtendedTerms>
  </Task>
  </Tasks>
  </Job>

See Also

Other Resources

Compute Cluster Server Command Line Interface Reference