Prev | Next |
Define Metamodel Constraints
When extending UML to develop a domain-specific Profile, Enterprise Architect allows you to specify constraints to restrict the connectors that can be drawn from a Stereotype, either using the Quick Linker or from the Toolbox. These constraints are defined using the relationships under the 'Metamodel' page of the 'Profile' toolbox.
Access
Ribbon |
Design > Diagram > Toolbox: > Profile |
Keyboard Shortcuts |
|
Add Metamodel Constraints to a Profile
Item |
Detail |
See also |
---|---|---|
Meta-Relationship |
A «metarelationship» connector between two Stereotypes is used to specify a valid UML Connector between these two Stereotypes. The name of the UML Connector should be set in the tag 'metaclass' on the «metarelationship» connector. In the Profile example, a «metarelationship» connector is drawn from ServiceSpecification to ServiceInterface and the name of the UML Connector is specified in the 'Tags' tab of the Properties window for the connector. After importing this Profile into a model, Enterprise Architect will show the UML Connector when the Quick Linker is used to draw a relationship between a ServiceSpecification and ServiceInterface. |
|
Meta-Constraint |
A «metaconstraint» connector between two Stereotypes is used to specify a constraint between these two Stereotypes. The constraint should be set in the tag 'umlRole' on the Meta-Constraint connector. In the Profile example, a «metaconstraint» connector is drawn from ActualProjectMilestone to ProjectMilestone and the constraint is specified as classifier on the tag 'umlRole' in the connector's Tagged Values. After importing this Profile into a model, Enterprise Architect will show only the ProjectMilestone stereotyped elements when assigning a classifier for ActualProjectMilestone element. Constraint values for the tag 'umlRole' include:
|
Constraints on Meta-Constraint connector |
Stereotyped Relationship |
You can use a «stereotypedrelationship» connector between two Stereotypes or Metaclasses to specify a valid stereotyped connector between instances of those elements. When specifying the relationship, if the relationship being referenced is defined in the profile in which the rule is defined, the stereotype property can be set to only the name of that stereotype. However, if the relationship is defined in another profile you must use a fully qualified stereotype name corresponding to where the stereotype is defined. In the Profile example, a «stereotypedrelationship» connector is drawn from ApplicationComponent to ApplicationEvent and the stereotype of the relationship is set to 'Assignment' in the connector's Tagged Values. After importing this Profile into a model, Enterprise Architect will show the 'Assigned' option when the Quick Linker is used to draw a relationship between an ApplicationComponent and ApplicationEvent. |
Metamodel Constraints and the Quick Linker |
Special Metaclasses
You can specify the source of a connector to be a superclass of all specialized forms, and the target to a special metaclass that specifies a relationship to the actual metaclass when it is used. You use one of these terms as the element name for a Class element with the stereotype «metaclass».
Item |
Detail |
See also |
---|---|---|
source.metatype |
The target element must match the exact stereotype defined at the source. |
|
source.metatype.general |
The target element can match the exact stereotype used at the source, and any concrete (isAbstract=false) generalized stereotypes. |
|
source.metatype.specific |
The target element can match the exact stereotype used at the source, and any concrete (isAbstract=false) specialized stereotypes. |
|
source.metatype.both |
The target element can match the exact stereotype used at the source, and any concrete (isAbstract=false) generalized or specialized stereotypes. |
|
<none> |
Use this metaclass name when you want to prevent the source element from inheriting the specified connector from its supertypes. |