You can customize the default severity levels (such as debug, info, warning, error, fatal) by creating new and and additional levels. For this you must edit the SeverityKind Enumeration element, located in the UML Standard Profile.
We do not recommend changing the UML Standard Profile.
To customize severity levels
After you create the custom severity level or modify the default severity, you can select it from from the drop-down list of the Severity property when specifying the validation rule properties. In the following figure the new severity level named critical can be selected as a value of the Severity property in the Specification window of validation rule (Constraint element). The value order in the Severity drop-down list is the same as they are listed in the SeverityKind Enumeration element.
The custom severity level named critical in the drop-down list of the Severity property in the validation rule specification.
Editing the UML Standard Profile
To edit the UML Standard Profile
- Open a project.
- In the Containment tree, click and enable to show the Show Auxiliary Resources in the Model Browser.
- Right-click the UML Standard Profile Package.
- Select Project Usages > Open. Learn how to manage project usages >>
The UML Standard Profile is now editable.
Creating new or modifying default severity levels
You can create new or modify default severity levels only if the UML Standard Profile is editable. To see how to edit the profile read the procedure above.
Each Enumeration Literal created for the Enumeration element corresponds to available severity levels.
To modify default severity levels (Enumeration Literals)
- In the Containment tree, click + to expand the UML Standard Profile Package > Validation Profile Package.
- Double-click the SeverityKind Enumeration element to open its Specification window.
- On the left side of the Specification window, select the Enumeration Literals property group.
On the right side of the Specification window, select severity level from the list:
- Click to open Specification window.
- Click the Up/Down button to move the severity level up/down in the list.Severity levels are listed in ascending order according to severity importance.
- Click the Clone button to create the same severity level. The Specification window of newly created Enumeration Literal opens. Type its unique name.
- Click the Delete button to remove the selected severity level from the model.- Click Close.
The default severity levels are modified.
To create a new severity level (Enumeration Literal)
- In the Containment tree, click + to expand the UML Standard Profile Package > Validation Profile Package.
- Double-click the SeverityKind Enumeration element to open its Specification window.
- On the left side of the Specification window, select the Enumeration Literals property group.
- On the right side of the Specification window, click the Create button. The Specification window of the newly created Enumeration Literal opens.
- In the Name property, type the name of the new severity level (e.g. critical).
Click Close.
The new severity level is created and can be modified by using buttons.
Defining new icon for severity level
You can define a different icon for a custom or default severity levels (Enumeration Literals). For this, you must create a new stereotype and specify its Icon and Metaclass properties.
To define a new icon for the severity level (Enumeration Literals)
- In the Containment tree, right-click the Validation Profile Package, and select Create Element > Stereotype.
- Type its name (e.g. criticalIcon) and press Enter.
- Double-click newly created Stereotype.
- In the Specification window of Stereotype specify the following properties:
- Select the Icon property value, click to select an image from the Image Library, or to select an image from your file system.
- Select the Metaclass property value, click and select EnumerationLiteral. - Click Close.
The new stereotype with a new icon is created and ready to be applied to a severity level. How to apply it >>
Applying new icon for severity level
After you define the new icon for severity level, you can apply it to custom or default severity levels (Enumeration Literals). This icon is shown when representing invalid elements of your model.
To apply a new icon to a severity level
- In the Containment tree, click + to expand the UML Standard Profile Package > Validation Profile Package > SeverityKind Enumeration element.
- Double-click the severity level (Enumeration Literals element) to which you want to apply a new icon.
- In its Specification window, select the Applied Stereotype property value.
- Click and select the newly created stereotype (e.g. criticalIcon) dedicated for this severity level.
- Select Apply.
- Click Close.
The new icon for the severity level is applied. In the figure below, the criticalIcon stereotype is applied to the new critical EnumerationLiteral element.