Reference (Template)

Applies To: Operations Manager 2007 R2, System Center Operations Manager 2007

Represents a reference to an external management pack.

Schema Hierarchy

ManagementPack
  Templates
    Template
      References (Template)
        Reference (Template)

Syntax

<Reference ID=”AliasName”/>

Attributes and Elements

The following sections describe attributes, child elements, and the parent element of the Reference element.

Attributes

Attribute Description

ID

Represents an alias that is defined in the containing management pack and is used in the template’s management pack fragment.

ID Attribute Values

Value Description

Any alias name.

Use an alias name so that the template can refer to elements defined in a management pack that is external to the management pack that defines the template. When the user runs the template to create a management pack fragment in the targeted management pack, that reference will be created in the targeted management pack if it does not already exist. For more information about how to reference elements in external management packs, see Reference (Manifest).

Self

Use this value so that the template can refer to elements defined in the management pack that defines the template.

Child Elements

None.

Parent Elements

Element Description

References (Template)

Contains references to external management packs.

Remarks

To see how a template refers to elements located within a referenced management pack, see the sample that follows or see Implementation (Template).

Warning

The creation of custom management pack templates is not supported in the current release of Operations Manager.

Example

The following sample XML sample illustrates a template that contains a single reference. The Windows reference alias must be defined in the management pack that is defining this template.

<Template ID="Microsoft.SystemCenter.TaskTemplates.ScriptTask" Purpose="TaskCreation">
  <Configuration>
    <xsd:element name="ID" type="xsd:string" />
    <xsd:element name="Name" type="xsd:string" />
    <xsd:element name="Description" type="xsd:string" />
    <xsd:element name="Target" type="xsd:string" />
    <xsd:element name="Category" type="xsd:string" />
    <xsd:element name="LocaleId" type="xsd:string" />
    <xsd:element name="ScriptName" type="xsd:string" />
    <xsd:element name="Arguments" type="xsd:string" />
    <xsd:element name="ScriptBody" type="xsd:string" />
    <xsd:element name="TimeoutSeconds" type="xsd:integer" />
  </Configuration>
  <References>
    <Reference ID="Windows" />
  </References>
  <Implementation>
    <Monitoring>
      <Tasks>
        <Task ID="$TemplateConfig/ID$" Target="$TemplateConfig/Target$" Accessibility="Public">
          <Category>$TemplateConfig/Category$</Category>
          <WriteAction ID="PA" TypeID="$Reference/Windows$Microsoft.Windows.ScriptWriteAction">
            <ScriptName>$TemplateConfig/ScriptName$</ScriptName>
            <Arguments>$TemplateConfig/Arguments$</Arguments>
            <ScriptBody>$TemplateConfig/ScriptBody$</ScriptBody>
            <TimeoutSeconds>$TemplateConfig/TimeoutSeconds$</TimeoutSeconds>
          </WriteAction>
        </Task>
      </Tasks>
    </Monitoring>
    <LanguagePacks>
      <LanguagePack ID="$TemplateConfig/LocaleId$" IsDefault="true">
        <DisplayStrings>
          <DisplayString ElementID="$TemplateConfig/ID$">
            <Name>$TemplateConfig/Name$</Name>
            <Description>$TemplateConfig/Description$</Description>
          </DisplayString>
        </DisplayStrings>
      </LanguagePack>
    </LanguagePacks>
  </Implementation>
</Template>

See Also

Reference

Implementation (Template)
Reference (Manifest)
References (Template)