Sometimes, you may find the standard modeling notations are not enough in supporting your domain specific needs. For example, if you are working on a project that relies heavily on the use of third-party libraries, you might want to specify the API source of those components modeled in UML component diagram. And in business process modeling, you might want to record the locations where the tasks are performed. Usually, these kind of specific needs cannot be directly supported by the standard notations.
Fortunately, OMG Unified Modeling Language (UML) introduces stereotype and tagged values, which provide designers with ideal solutions to these situations. Stereotype and tagged values are kind of extensibility mechanisms that allow designers to extend the vocabulary of UML in order to create new model elements. With the use of stereotype and tagged values, designers can introduce model elements with domain/problem specific properties.
Starting from UML 2.0, tagged values are considered to be attributes of stereotype. Yet, Visual Paradigm supports to use tagged values independently, that is, to add tagged values directly to model elements as custom properties instead of prior attachment to any stereotype. Besides, Visual Paradigm allows you to take the advantage of stereotypes and tagged values in not just UML but all the modeling notations like BPMN and even in ERD, DFD, etc. Simply put with Visual Paradigm, you can add custom properties to any model elements by creating tagged values.
Adding user-defined tags
- Right click on the selected shape and select Open Specification… from the pop-up menu.
- In Specification window, select Tagged Values tab and click Add button to select the tag type.
Different types of tagged values
|Text||String-based value. To edit, double click on the Value cell and enter the value.|
|Multi-line Text||String-based value, in multiple lines. To edit, click on … in the Value cell, and then enter the value in the popup window.|
|Model Element||Reference(s) of model element. To edit, click the reverse triangle button of Value, and then select the model element from the popup window.|
|HTML Text||Value in rich-text. HTML is a hidden tagged value. To reveal this option, select Window > Project Options from the toolbar. When the Project Options window, select Diagramming > Environment tab and check Support HTML tagged value.
To edit an HTML value, click on … in the Value cell, and then enter the value in the popup window.
|Integer||Numerical value. To edit, double click on the Value cell and enter the value.|
|Floating Point Number||Value with decimal places. To edit, double click on the Value cell and enter the value.|
|Boolean||Either true or false, or leave unspecified. To edit, click on the drop-down menu in the Value cell, and then select Unspecified, Trueor False.|
|Date||Date value. To edit, click on … in the Value cell, and then select the date from the popup date picker.|
|Time||Time value. To edit, click on … in the Value cell, and then select the time from the popup time picker.|
|Currency||String-based value. To edit, double click on the Value cell and enter the value (e.g. USD, RMB).|
|Enumeration||String-based value that supports the selection of value from a list of pre-defined enumeration values. To add such a tagged value, you have to define the enumeration and its values first in the Configure Tagged Value Enumerations window, for instances, to define an enumeration ‘Stakeholders’ that consists of values ‘Peter, Mavis, Tom’. Then, add a new tagged value by creating a new type from an enumeration, for instances, a new type ‘Contact person’ from the enumeration ‘Staskeholders’. Then, you can select a value from the enumerated type.
You can open the Configure Tagged Value Enumerations window by selecting Window > Configuration > Configure Tagged Value Enumerations… from the application toolbar.
The value of stereotype can be edited, however, its name and its type cannot be edited as they are defined in stereotype.
Visualizing tagged values on diagram
Right click on the diagram background and select Presentation Options > Show Tagged Values from the pop-up menu.
If it is defined, the tagged values will be seen within the shape(s) on the diagram.
Creating default tagged values
Besides adding tagged values to model elements, you can make a tag as the default of certain model element type. This is an ideal solution for creating custom properties for model elements. For instance, you can create a default tag “API” to UML class. Then, when you create a class, the tag “API” will be added to the class automatically. You can then specify the tagged values of “API” of that class.
To create default tagged values:
- Select Configuration > Configure Default Tagged Values under the Window tab of the toolbar.
- Select the type of model element to be configureon on the left hand side.
- Click Add on the right hand side to select the tag type.
- Input the tag name and default value, if any.
- Click OK to confirm the changes.