To create a new tagged value, do one of the following
- In the element Specification window, Tags property group, select an available tag definition and click the Create Value button.
- In the Containment tree, select an element and drag it to the Specification window tag value area.
To create default tag values
- In the stereotype's Specification window, expand the Tag Definitions property group and select the tag definition.
- Assign a value for the Default Value property.
- Create an element and assign a stereotype for this element. The element will have tags with assigned default values.
Setting a default tag value to tag with empty value
MagicDraw allows for setting default tag values to a tag with an empty value. This functionality is needed when a stereotype is already assigned to an element and a new mandatory tag definition with a default value is created for the stereotype. After creating such a tag definition, the model elements that have the modified stereotype applied will have the newly created tags unset.
To set default values instead of empty values
- In the main menu, select Tools > Set Empty Tags to Defaults. The Select Package dialog opens.
Select the scope of elements to which you want to set the default tag values.
If you want to assign default values to all project tags, in the All data tree select the root package Data and click the Add All button. The root package Data is added to the Selected objects list. Click OK.
- In the opened dialog, click Yes. Now, the element with stereotype tags has been assigned default values.
The following conditions are required to set the default tag values
- The element should have an assigned stereotype with a specified default value property.
- The tag definition, to which you want to assign a default value, should contain no value.
The default tag values are not set when the stereotype property (tag definition) multiplicity is equal to 0, 0..1, 0..*, *.