Use this screen to manage class definition of configuration item classes. The configuration item class management screen is available in the Configuration Items module of the CMDB Settings group.
To add or edit the class definition of a configuration item class:
-
Select a class from the drop-down menu in the left sidebar.
-
Click on the Change class definition button.
-
Add or edit the class definition in YAML format.
-
Click on the Save or Save and finish button.
To see the class definition of a configuration item class:
-
Click on a class name in the list of classes.
-
Select a version by clicking on a class name in the list of class versions.
See also
New configuration item classes can be added in General Catalog module in the administrator interface.
Class Definition Types and Form Elements
Multiple input field types can be used when defining a class. These input field types are used to generate the edit form for creating new or editing already existing configuration items.
The following block is an example of a form field called Operating System.
---
- Key: OperatingSystem
Name: Operating System
Input:
Type: Text
Size: 50
MaxLength: 100
The following settings are available when adding or editing this resource. The fields marked with an asterisk are mandatory.
Key
*-
Must be unique and only accept alphabetic and numeric characters. If this is changed, data will not be readable from old definitions.
Name
*-
The label of the field in the form. Any type of characters can be entered to this field including uppercase letters and spaces.
Note
It is recommended to always use English words for names.
See also
Names can be translated into other languages with custom language files. For more information, see the Custom Language File chapter in the administration manual.
Searchable
-
Defines whether the field is searchable or not. Possible values are 0 or 1.
Input
*-
Initiates the definition of the input field. An input field can contain the following attributes:
Type
*-
Defines the type of the element. Must be placed indented as a logical block. Possible values are:
-
Customer
: A drop-down list for select a customer user from the database back end. The field can be used with wildcards (*). -
CustomerCompany
: A drop-down list for select a customer from the database back end. -
Date
: A field for select a date. -
DateTime
: A field for select date and time. -
Dummy
: This field is used to give the other elements a structure. It has usuallySub
structures. -
GeneralCatalog
: A drop-down list for select a general catalog class. The general catalog class must be defined before use it as input type. The items of the general catalog class will be the options of the drop-down list. -
Integer
: A drop-down list with integer numbers. -
Text
: A single text field. -
TextArea
: A text field with multiple rows.
-
Required
-
Defines whether the field is mandatory or not. Possible values are 0 or 1.
Size
-
Defines the size of the text field. The value must be a positive integer.
MaxLength
-
Defines the maximum amount of characters that can be entered in the text field. The value must be a positive integer.
RegEx
-
A regular expression to restrict the possible values of the text field.
RegExErrorMessage
-
The displayed error message if the input does not match to definition given in the regular expression.
Class
-
The name of the class to be used for the drop-down list. Required for type
GeneralCatalog
. Translation
-
Defines whether the items of a general catalog have to be translated. Possible values are: 0 or 1.
YearPeriodPast
-
Defines how many years in the past are available for selection from the present year in a date or date/time field. The value must be a non-negative integer.
YearPeriodFuture
-
Defines how many years in the future are available for selection from the present year in a date or date/time field. The value must be a non-negative integer.
ValueMin
-
Defines the minimum value for an integer field.
ValueMax
-
Defines the maximum value for an integer field.
ValueDefault
-
Defines the default value for an integer field.
CountMin
-
Defines at least how many of the current input types are available. The value must be a non-negative integer.
CountMax
-
Defines at most how many of the current input types are available. The value must be a non-negative integer.
CountDefault
-
Defines how many field should be displayed by default. The value must be a non-negative integer.
Sub
-
Defines a sub-element in the input field. The sub-element can contain its own input fields. It is useful if you have certain properties under a main property.
SuppressVersionAdd
-
This can be used to suppress creating a new version of a configuration item, when an attribute has changed. Possible values are
UpdateLastVersion
andIgnore
.-
UpdateLastVersion
: If this value is set and there is no other updated attribute, the attribute is updated in the current version without creating a new version. -
Ignore
: If this value is set and there is no other updated attribute, nothing will be done, and no new version is created.
-
Class Definition Reference
The following class definition is an example for all possible options.
Note
The CustomerID
and Owner
are special keys, since these keys are used in Customers and Customer Users to assign configuration items automatically to customers and customer users by default.
---
- Key: OperatingSystem
Name: Operating System
Searchable: 1
Input:
Type: Text
Required: 1
Size: 50
MaxLength: 100
RegEx: Linux|MacOS|Windows|Other
RegExErrorMessage: The operating system is unknown.
CountMin: 0
CountMax: 5
CountDefault: 1
- Key: Description
Name: Description
Searchable: 0
Input:
Type: TextArea
Required: 0
CountMin: 0
CountMax: 1
CountDefault: 0
- Key: Type
Name: Type
Searchable: 1
Input:
Type: GeneralCatalog
Class: ITSM::ConfigItem::Software::Type
Required: 1
Translation: 1
- Key: EndUserInformation
Name: End User Information
Input:
Type: Dummy
Sub:
- Key: CustomerID
Name: Customer Company
Searchable: 1
Input:
Type: CustomerCompany
- Key: Owner
Name: Owner
Searchable: 1
Input:
Type: Customer
- Key: LicenseKey
Name: License Key
Searchable: 1
Input:
Type: Text
Size: 50
MaxLength: 50
Required: 1
CountMin: 0
CountMax: 100
CountDefault: 0
Sub:
- Key: Quantity
Name: Quantity
Input:
Type: Integer
ValueMin: 1
ValueMax: 1000
ValueDefault: 1
Required: 1
CountMin: 0
CountMax: 1
CountDefault: 0
- Key: ExpirationDate
Name: Expiration Date
Input:
Type: Date
Required: 1
YearPeriodPast: 20
YearPeriodFuture: 10
CountMin: 0
CountMax: 1
CountDefault: 0
- Key: LastUsed
Name: Last Used
Input:
Type: DateTime
Required: 1
CountMin: 0
CountMax: 1
CountDefault: 0
SuppressVersionAdd: UpdateLastVersion