Add an Enumeration to a Stereotype

Enumeration elements can be used to generate a drop-down list of values for a Tagged Value associated with a Stereotype element. The list is displayed, and the value selected, in the Tagged Values window.

In the example below, the enumeration Color provides the drop-down list of values (Yellow, Red, Green) for the myTag Tagged Value on the myStereotype element.

my profile

Add an Enumeration to the Stereotype

Step

Description

See also

1

Open the Profile package child diagram.

 

 

2

In the Toolbox, select More tools | Profile.

The Profile pages of the Toolbox display.

 

 

3

Drag an Enumeration item from the Toolbox onto the diagram.

If the Properties dialog does not display, double-click on the element on the diagram.

 

 

4

In the Name field, type the name of the new Enumeration element.

 

 

5

Click on the Details tab and on the Attributes button.

The Attributes Properties dialog displays.

 

 

6

In the Name field, type the name of the Enumeration attribute (for example, Yellow).

 

 

7

In the Type field, click on the drop-down arrow and select the appropriate type (such as int or string).

 

 

8

Click on the Save button and the New button, and repeat steps 6 to 8 for additional attributes, to define the other values for the drop-down list.

 

 

9

When you have defined all the values, click on the Close button.

 

 

10

Right-click on the Stereotype element and select the Attributes context menu option.

The Attribute Properties dialog displays for the stereotype.

 

 

11

In the Name field type a name for the attribute.

 

 

12

In the Type field click on the (  ...  ) button and select the name of the Enumeration element from the Select <Item> dialog.

 

 

13

In the Initial field type the name of the required Enumeration attribute that defines the default value.

 

 

14

Click on the Save and Close buttons.

You have now generated a drop-down list for setting the value of the tag in the Tagged Values window. When the Profile is in use, the Tagged Value for an element created with the stereotype might appear as shown:

 

stereoresult

 

 

Learn more

Learning Center topics

(Alt+F1) | Modeling Languages | Build a Profile | Define Enumeration Tagged Values 1
(Alt+F1) | Modeling Languages | Build a Profile | Define Enumeration Tagged Values 2