Property (ClassType)
Applies To: System Center Service Manager 2010
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Represents a property of a class type defined in a management pack.
Schema Hierarchy
ManagementPack
TypeDefinitions
EntityTypes
ClassTypes
ClassType
Property
Syntax
<Property ID=”PropertyName” Comment=”Comments” Type=”datatype” AutoIncrement=”True/False” Key=”True/False” CaseSensitive=”True/False” MaxLength=”int” MinLength=”int” Scale=”int” Required=”True/False” MinValue=”int” MaxValue=”int” RegEx=”regularexpressionstring” enumType=”enumtype” DefaultValue=”simple type” >
</Property>
Attributes and Elements
The following sections describe attributes, child elements, and the parent element of the Property element.
Attributes
Attribute | Description |
---|---|
ID |
Required attribute. Represents the identity of the property. 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. |
Type |
Required attribute. Represents the data type of the property. |
AutoIncrement |
Optional attribute. Represents whether or not this property value auto increments for each new instance created in the system. If not specified, the value defaults to False. This attribute is valid only on a numeric property type. |
Key |
Optional attribute. Defines whether or not this property is the key property of the class type. If not specified, the value defaults to False. |
CaseSensitive |
Optional attribute. Pertains only to properties of type string. Defines whether or not this property’s value is case sensitive. If not specified, the value defaults to False. |
MaxLength |
Optional attribute. Defines the maximum length of the string value. Value must be between 1 and 65,536 inclusively. |
MinLength |
Optional attribute. Pertains only to properties of type string. Defines the minimum length of the string value. Value must be between 0 and 65,536 inclusively. |
Scale |
Optional attribute. |
Required |
Optional attribute. Indicates whether or not this property is required for all class type instances. If not specified, the value defaults to False. |
MinValue |
Optional attribute. Defines the minimum value of the property. This attribute is valid only on a numeric property type. |
MaxValue |
Optional attribute. Defines the maximum value of the property. This attribute is valid only on a numeric property type. |
RegEx |
Optional attribute. Defines a restriction on a property value as a regular expression. |
EnumType |
Optional attribute. If this property is of the enum data type, it is required. Defines the EnumerationTypes that this property value is restricted to. |
DefaultValue |
Optional attribute. Defines the default value of this property. |
Type Attribute Values
Value | Description |
---|---|
int |
Indicates the property is of integer type. |
decimal |
Indicates the property is of decimal type. |
double |
Indicates the property is of double type. |
string |
Indicates the property is of string type. |
datetime |
Indicates the property is of datetime type. |
guid |
Indicates the property is of GUID type. |
bool |
Indicates the property is of Boolean type. |
Key Attribute Values
Value | Description |
---|---|
True |
Indicates that the property is a key property and used to uniquely identify an instance of this class type. For more information on key properties, see the Remarks section. |
False |
The default value. Indicates that the property is not the key property of the class type. |
Child Elements
None.
Parent Elements
Element | Description |
---|---|
Represents a class type definition in the management pack. |
Remarks
Key Properties
Key properties are used to uniquely identify an instance of a class type within a hosting class or, if not hosted, within the management group. If a class type is hosted and more than one instance of the class type is expected, a Key attribute on one of its properties must be set to true. If only one instance of the hosted class type is expected, defining a key property is recommended but not mandatory. If a class type is not hosted and its base class type does not define a key property, the Key attribute on one of its properties must be set to True to ensure instance uniqueness within the system.
Note
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.
Example
The following XML sample illustrates the RegEx and AutoIncrement attributes of the Property element. The UserDocument
class type requires that the DocumentName
property must follow the format specified by the regular expression. In this case, it is required that the name must consist of the word “User” followed by any number. The Id
property in the sample will be automatically incremented with each new UserDocument
instance created in the system.
<ClassType ID=”UserDocument” Accessibility=”Public” Base=”System!System.Entity”>
<Property ID=”Id” Type=”int” Key=”true” AutoIncrement=”true”/>
<Property ID=”DocumentName” Type=”string” RegEx=”User[0-9]+” />
</ClassType>