Prev Next

With Predefined Tag Types

Tagged Values define a wide range of properties and characteristics of a model element, and some of these properties have complex or structured values. For example, you might want your user to select a value between upper and lower limits (using 'Spin' arrows), set a date and time, select a color from a palette, or work through a checklist.

You create these complex Tagged Values from any of a number of predefined simple Tagged Value types and filters, some of which you might have created yourself, using  the 'Data Type' element in the 'Profile' page of the Diagram Toolbox.

The enormous advantage of using a Data Type element is that it helps you define Tagged Values that are specific to the profile, so you can create Tagged Values of different types with the same name in different profiles, without conflict in running the MDG Technologies derived from those profiles.

This method is recommended for creating complex Tagged Values in profiles, from predefined simple Tagged Value types and filters. The original method of defining global Tagged Value types in the UML Types dialog is still supported for the purposes of maintaining existing profiles; see the With Predefined Tag Types (Legacy Profiles) Help topic.

Assign Tagged Values to Stereotypes

Having created a structured Tagged Value, you assign it to the Stereotype element in the same way as for simple Tagged Values, by creating an attribute in the Stereotype element with the name of the Tagged Value Type.

Example

Consider the example of 'StartDate' and 'EndDate' Tagged Values. Using the Data Type element, you would define one - say - 'DateProperty' Tagged Value Type in the Notes of the Tagged Value (using the definitions listed in the Predefined Structured Types Help topic), and refer to that Data Type from any number of attributes in the Stereotype elements - such as 'StartDate' and 'EndDate'. This definition, and its referrents, have no involvement with any other definitions outside their parent Package.

To extend this example, say you have Stereotypes called 'Holiday' and 'Meeting', and both have StartDate and EndDate properties. However, 'Holiday' uses 'DateProperty' with a definition of "Type=Date;", while 'Meeting' could use 'DateTimeProperty' with a definition of "Type=Timestamp;".

When the profile is imported into a user's model (either as a standalone profile or as a component of an MDG Technology), the stereotypes can be applied to new or existing elements, and the Tagged Value types are added (and are made available when creating more tags in the 'Tagged Value' dialog drop-down). In this illustration, the Time Periods profile has been imported into the 'Resources' tab for the model, and is about to be used to tailor two standard Class elements that exist on a diagram.

The 'Meeting' profile element is now Ctrl+dragged onto the Team Meetings Class, and the 'Holiday' profile element is Ctrl+dragged onto the Public Holidays Class. The result is that both Class elements take the appropriate stereotypes, which are displayed on the elements in the diagram and in the 'Stereotype' field on the 'Element' tab of the Properties window. Notice also that there is a stereotype group on the 'Element' tab, listing the tags defined for the stereotype.

For the Team Meetings element, we have just typed a value into the 'Start Date' field on the element, which immediately displays in the 'tags' compartment on the element on the diagram.

If you need to add the stereotype tags to other Class elements, once the profile is imported you can do so through the 'Tags' tab of the Properties window for each element, selecting whichever format is most appropriate for the element. Note how the two formats differ in this example, where both data types are inserted.

Learn More