Normally, tags are used to hold additional specific information. This information helps interpret basic elements differentiated by some external tools, such as transformations, code engineering, etc.

In these cases, you only want to mark the model, not make an impact on existing diagrams.

Tag definitions are properties of stereotype in UML2. UML does not allow using tagged values without assigning stereotype. Your diagrams will be changed when some tags are added into the model.

A modeling tool enables you to make chosen stereotypes or tags in diagrams invisible.


To make a stereotype invisible


The stereotype you want to make invisible must be inherited from «InvisibleStereotype» found in the modeling tool (e.g., MagicDraw) profile.

  1. Create a custom stereotype.
  2. Create a Generalization between your stereotype and InvisibleStereotype. Your custom stereotype will be not displayed on symbols where it is applied. Note that all tags will also be invisible on symbols.


Example

It is not desirable to see an author tag in diagrams. To accomplish this, follow these steps:

  1. Create a stereotype «copyrighted» that extends the Element metaclass. 

  2. Create a property “author: String” for a «copyrighted» stereotype. 

  3. Inherit this stereotype from «InvisibleStereotype» (create generalization in the model or diagram).

Now you may enter the tagged value “author” for any element in your model.

The stereotype «copyrighted» will be automatically applied but will be invisible in diagrams. 


To create an invisible tag


  1. Apply «InvisibleStereotype» on your tag definition (a property of a stereotype). 

Hidden Tags

All hidden tags will be invisible on the symbols of stereotyped elements.

Example:

The stereotype «identification» has two tags: ID and Description. The user would like to see a Description value on elements in diagrams, but ID should be hidden as it is used in some external model transformation tools or similar activities.

Apply «InvisibleStereotype» on the ID property of the «identification» stereotype and it will be not visible on stereotyped elements on diagrams.


To make a constraint invisible


  1. Apply the «InvisibleStereotype» stereotype to the constraint. 
  2. Invisible constraints may be used while creating validation constraints, in DSL customization, or in other modeling cases.