[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Represents a class type definition in the management pack.

Schema Hierarchy

ManagementPack
  TypeDefinitions
    EntityTypes
      ClassTypes
        ClassType

Syntax

Xml
<ClassType ID=”Company.Product.ClassID” Comment=”Comment” Accessibility=”Internal/Public” Abstract=” True/False” Base=”BaseClassID” Hosted=” True/False” Singleton=”True/False” Extension=”True/False”>   <Property>…</Property>
</ClassType>

Attributes and Elements

The following sections describe attributes, child elements, and the parent element for the ClassType element.

Attributes

Attribute Description

ID

Required attribute. Represents the identity of the element. To learn how to identify your element in a management pack, see Element Identity and Namespace Conventions.

Comment

Optional attribute. Represents commentary by the management pack author.

Accessibility

Required attribute. Defines the visibility of the class type.

Abstract

Required attribute. Defines whether or not the class type is abstract or concrete.

Base

Required attribute. Contains the ID of the class type from which the class type inherits or, if this class type is an extension, the root base class type of the inheritance tree that this class type is to extend.

Hosted

Optional attribute. Defines whether or not this class is hosted. Default value is False.

Singleton

Optional attribute. Defines whether or not this class is a singleton. Default value is False.

Extension

Optional attribute. Defines whether or not this class is an extension class type. Default value is False.

Accessibility Attribute Values

Value Description

Public

Indicates that this class type is visible to external management packs for targeting or inheritance.

Internal

Indicates that external management packs cannot reference this class type.

Abstract Attribute Values

Value Description

True

Indicates that this class type cannot be instantiated. Set to True if the intention is to use this class type as a base class only. When used as a base class, all of its properties and relationships are inherited by the derived classes. In addition, any monitors that target the abstract base class are inherited by the derived classes.

False

Indicates that this class type can be instantiated.

Base Attribute Values

Value Description

The ID of a predefined class type.

All defined class types must specify the ID of the class type from which they inherit or to which they apply an extension.

Hosted Attribute Values

Value Description

True

Indicates that this class type is hosted by another class type. Instances of the hosting class must be discovered before instances of this class type can be discovered. For more information about hosting relationships, see Management Pack Classes.

If an instance of the hosting class is to contain more than one instance of this class type, a key property must be defined. If only one instance will be discovered, no key property is required. For more information about key properties, see Property (ClassType).

Note
If the class type does not already inherit a hosting relationship, a RelationshipType element of base class System.Hosting must be defined that describes the hosting class type of the hosted class type.

False

Default value. Indicates that this class type is not hosted by another class type. To ensure uniqueness within the management group, a key property must be defined for this class type unless its base class type already defines one. For more information about key properties, see Property (ClassType).

Singleton Attribute Values

Value Description

True

Indicates that this class type is to be created when the management pack is installed and that only one instantiation will ever exist in the system. A singleton class type never requires a discovery.

False

Indicates that the class requires a discovery for instantiation. Always set to False if there is a possibility that there will be multiple instances of the ClassType element.

Extension Attribute Values

Value Description

True

Indicates that this class type defines a new property or properties to also be available as properties on all of the base class types in its inheritance tree.

False

Indicates that this class type is not an extension to each base class type in its inheritance tree.

Child Elements

Element Description

Property (ClassType)

Optional element if the class type’s Hosted attribute is set to True or if Hosted attribute is set to False and the class type is a singleton. If Hosted is set to False, a key property must be set. For more information about the Key property, see Property (ClassType).

Parent Elements

Element Description

ClassTypes

Contains definitions of class types to be discovered and/or monitored.

Remarks

A class type represents either an entity type within your service model or an extension to all class types that make up a particular inheritance tree. All class types are either the target or workflow rules or are definitions of objects to be stored and/or processed within a workflow.

A display string for each class type and each property defined within a class type should be defined in the display string section of the management pack for at least one language. For more information, see DisplayStrings.

Whenever a class type instance is created within the system, that instance will be displayed in the Service Manager console. If you do not want your class type to inherit the default image of its base class type, you must create an Image element and associate your class type with that image by defining an ImageReference element.

You can define class type templates to supply default property values to instances of any type projection in the system. For more information, see ObjectTemplate.

Example

The following XML sample shows how two abstract class types are defined. The Microsoft.SQLServer.Component class type is created to represent all SQL Server components. It is an abstract class type, which means that it is used solely as a base class type for other class types. The abstract Microsoft.SQLServer.Agent class type derives from the abstract Microsoft.SQLServer.Component class type and provides three properties, one of which is a key to uniquely identify each instance of the class type. The key is required because the parent base class does not provide a key property. For more information about key properties, see Property (ClassType).

  Copy Code
<TypeDefinitions> 
 <EntityTypes> 
   <ClassTypes> 
   <ClassType ID="Microsoft.SQLServer.Component" Accessibility="Public" Base="Windows!Microsoft.Windows.ApplicationComponent" Hosted="false" Abstract="true"  Singleton="false"/> 
   <ClassType ID="Microsoft.SQLServer.Agent" Accessibility="Public" Base="Microsoft.SQLServer.Component" Hosted="false" Abstract="true" Singleton="false"> 
	<Property ID="ServiceName" Type="string" Key="true" />
	<Property ID="Account" Type="string" /> 
	<Property ID="DisplayName" Type="string" /> 
   </ClassType> 
  </ClassTypes> 
 </EntityTypes> 
</TypeDefinitions>

The following XML sample shows how to extend all class types within a particular inheritance tree. The Base attribute of the System.SolutionSettings.Extension class type defines the top of the inheritance tree (System.SolutionSettings). The System.SolutionSettings class type and all class types that inherit from it (System.GlobalSetting.ActivitySettings and System.GlobalSetting.ChangeSettings) will now support the NewProperty property.

  Copy Code

<ClassType ID="System.SolutionSettings" Accessibility="Public" Base="System.GlobalSetting" Hosted="false" Abstract="true" />

<ClassType ID="System.GlobalSetting.ActivitySettings" Accessibility="Public" Base="AdminItem!System.SolutionSettings" Hosted="false" Abstract="false" Singleton="true">
  <Property ID="SystemWorkItemActivityManualActivityIdPrefix" Type="string" DefaultValue="MA" />
  <Property ID="SystemWorkItemActivityReviewActivityIdPrefix" Type="string" DefaultValue="RA" />
  <Property ID="SystemWorkItemActivityIdPrefix" Type="string" DefaultValue="AC" />
</ClassType>

<ClassType ID="System.GlobalSetting.ChangeSettings" Accessibility="Public" Base="AdminItem!System.SolutionSettings" Hosted="false" Abstract="false" Singleton="true">
  <Property ID="SystemWorkItemChangeRequestIdPrefix" Type="string" DefaultValue="CR" />
  <Property ID="MaxFileAttachmentsCount" Type="int" DefaultValue="10" />
  <Property ID="MaxFileAttachmentSizeinKB" Type="int" DefaultValue="64" />
</ClassType>

<ClassType ID="System.SolutionSettings.Extension" Accessibility="Public" Base="System.SolutionSettings " Hosted="false" Abstract="false">
  <Property ID=”NewProperty” Type=”int”/>
</ClassType>



See Also