You can add a group that contains custom properties for elements
to a capsule-based UML model. The new group of customized properties is displayed
in the Properties view, on the RT Properties page,
for the elements to which the property set applies.
Before you begin
Restriction: For all new «Set» stereotypes, the combination
of the group name and element type must be unique, so you cannot add custom
properties to an existing group.
About this task
To add a custom group of properties:
Procedure
- Create a new profile.
- Apply the PropertySet profile to the new profile.
- Apply the PropertyProfile stereotype to the new profiles.
- For the PropertyProfile stereotype, set the value of the category
attribute to the domain of the group of properties.
- Create a stereotype. The Set stereotype is automatically applied
to the newly created stereotype.
- Add an extension to the appropriate metaclass, and also to the
metaclass named Package.
- Add attributes to the stereotype for the custom properties; for
each attribute that is created, define a type and a default value.
- For the Set stereotype, set the category and subcategory attributes
to the appropriate type and group name for the property set.
- Repeats steps 5-8 for each custom group to add.
- Apply the new profile to a model to make its property sets available
to that model.
Example
For example, the following figure shows a property profile for the
C++ domain that defines a new group called “Custom” for classes that contains
a Boolean property called “finished”, and a new group called “Extras” for
capsules that contains a string property called “Author”.
Note: To define a new enumerated type for a custom property, create
an enumeration element in an extended profile, and use it as the type of the
property.