Prev | Next |
Add Stereotypes and Metaclasses using Profile Helpers
You can define Stereotypes in a Profile to either extend:
- Core UML objects (Metaclasses pre-defined in Enterprise Architect), or
- Objects (Stereotypes) defined by other Profiles and technologies (for instance objects defined in ArchiMate or SysML)
Stereotypes can extend Metaclasses in several ways:
- One Stereotype extending one Metaclass, for a specific definition of one object type
- One Stereotype extending more than one Metaclass, where the definition applies to more than one object type - such as modifying both a Class and an Object in the same way
- Several Stereotypes extending one Metaclass, where you are creating several variations of the same base object type; for example, to define types of Association connector, representing Parent, Sibling, Grandparent, Uncle/Aunt and Cousin relationships
Add Metaclasses and Stereotypes to a Profile
Step |
Description |
See also |
---|---|---|
1 |
If you are extending a non-UML type defined by an existing Profile or technology, follow the process described in the Create Stereotypes Extending non-UML Objects Help topic. |
Create Stereotypes Extending non-UML Objects |
2 |
In the Browser window, locate the Package with the <<profile>> Stereotype and open its child diagram. |
Create Stereotype Profiles using Profile Helpers |
3 |
Drag the 'Add Stereotype' icon from the 'Profile Helpers' page of the Diagram Toolbox onto the diagram. The 'Add Stereotype' dialog displays. |
|
4 |
In the 'Name' field, type the Stereotype name (which will also be the name of the new modeling object). |
|
5 |
Select one of these object groups by clicking on the 'Type' drop-down arrow:
|
|
6 |
Click on the . The 'Extend Metaclass' dialog displays, showing a list of object types associated with the object group selected in step 5. Select the Metaclass to be extended from the list and click on the . If you selected 'Metaclass Extension' in step 5, the 'Select a Profile Element browser/search' dialog displays; search for and select the existing Metaclass element to extend with this Stereotype. The Metaclass name is added to the 'Extensions' field. |
|
7 |
If you want to extend more than one Metaclass with the Stereotype, click on the again and select the next object type to extend. You can repeat this for as many Metaclasses as you want to extend with this Stereotype. To delete a selected Metaclass from the 'Extensions' list click on the . |
|
8 |
Review the available properties in the 'Stereotype' panel. These properties modify the behavior of the Stereotype. To apply a property, click in the 'Value' field and type or select the appropriate value. When you select a property field, a description of the property's effect is displayed at the bottom of the 'Stereotype' panel. Only provide values for properties that you want to apply to this Stereotype. |
|
9 |
Click on the name of a Metaclass in the 'Extensions' field and review the available properties in the 'Metaclass' panel. These properties further modify the behavior of the stereotype based on options specific to the Metaclass being extended. To apply a property, click in the 'Value' field and type or select the appropriate value. When you select a property field, a description of the property's effect is displayed at the bottom of the 'Metaclass' panel. Do not provide values for any properties that you do not want to apply to this Stereotype. If you are extending more than one Metaclass, click on the next Metaclass name in the 'Extensions' field and review the properties for that object type. |
|
10 |
Click on the . The 'Define Tagged Values' page displays. |
|
11 |
In the 'Property' panel right-click to display a context menu with options for creating and grouping Tagged Values of different types. These options include:
|
Add an Enumeration to a Stereotype Create Tagged Value Type from Predefined Types Define a Structured Tagged Value Predefined Structured Types Define Tag Groupings |
12 |
Click on the . The 'Define a Shape Script' page displays. A Shape Script can be used to define the appearance of the Stereotype. To include a Shape Script, click on the . The Shape Editor window displays. Create your Shape Script using this editor. When you have finished creating the Script, click on the . The image defined by the Shape Script is shown in the 'Preview' panel. Note: For the Shape Script to take effect, you must select the 'Alternate Image' option when you save the Profile. Alternatively, you can define a simple default appearance (background color, line color) for the model object, after you have created the Stereotype element. |
Shape Scripts Shape Editor Export a Profile |
13 |
Click on the . The Stereotype element and Metaclass element(s) are now displayed on the Profile diagram. |
|
14 |
You can now:
|
Edit a Stereotype Element Define Stereotype Constraints Set Default Appearance Quick Linker |
Notes
- If you intend to extend a large number of model elements, rather than putting all of them on one diagram you can create additional child Class diagrams under the <<profile>> Package and add different types of Metaclass element to different diagrams; in this case you save the Package as the Profile, not the individual diagrams
- Stereotype elements must have unique names, but Metaclass elements can have the same name (for example, there can be several Action Metaclasses, each with a different ActionKind attribute)
- If you have a number of Tagged Values in the Stereotype element, and you have assigned them to groups, you can define which of those groups default to expanded (open) in the 'Tags' tab of the Properties window, and which default to closed; open the Features window for the Metaclass, at the 'Attributes' page, and add the attribute _tagGroupStates with the initial value <groupname>=closed;<groupname>=closed;<groupname>=open; ...