Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

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 'Tags' tab of the Properties window.

Following on from the topic Define Stereotype Tagged Values, this example illustrates how the enumeration 'Color' can be used to provide a drop-down list of values ('Yellow', 'Red', 'Green') for the 'myTag' Tagged Value on the element 'myStereotype'.

A UML Profile diagram showing the definition of a stereotype with a tagged value. The tagged value is an enumeration and has a default initial value.

Add an Enumeration to the Stereotype



See also


Open the Profile Package child diagram.

On this diagram, we should already have the element <<metaclass>> Class and the stereotype element 'myStereotype'.

Create a Profile Package


In the Toolbox, locate and select the 'Profile' pages.

Diagram Toolbox


Drag the 'Enumeration' icon from the Toolbox onto the diagram.


If it is not already showing, open the 'Properties' dialog.

Ribbon: 'Design > Element > Properties > General > Properties Dialog' (or press Alt+2)


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


If it is not already showing, open the Features window at the 'Attributes' page:

Ribbon: 'Start > All Windows > Properties > Element Features > Attributes


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


Click on the New Attribute text and type the name of the next Enumeration attribute. Repeat this step for additional attributes, to define the other values for the drop-down list.


Right-click on the Stereotype element 'myStereotype' and select the 'Features > Attributes' option.

The Features window displays for the stereotype, at the 'Attributes' page.


In the 'Name' field type a name for the attribute.


In the 'Type' field click on the drop-down arrow and on the 'Select Type' option, and browse for and select the name of the Enumeration element from the 'Select <Item>' dialog.


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


Click on the Close button.

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

A UML Class diagram that shows a stereotyped class with a tagged value that is defined as an enumeration.  The Tagged Value can be set in the tagged values docked window, in Sparx Systems Enterprise Architect.

Learn more