Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

Define Metamodel Constraints

When extending UML to develop a domain-specific Profile, Enterprise Architect allows you to specify constraints that enable restricting 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: Hamburger icon > Profile

Keyboard Shortcuts

Alt+5

Add Metamodel Constraints to a Profile

Item

Detail

See also

Meta-Relationship

A Meta-Relationship 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 Meta-Relationship connector.

Showing how the metarelationship connector can be used to automatically create quicklinker definitions.

In the Profile example, a Meta-Relationship connector is drawn from ServiceSpecification to ServiceInterface and the name of the UML Connector is specified in the connector's Tagged Values window.

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 Meta-Constraint 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.

Showing how the metaconstraint connector can be used to define model validation rules.

In the Profile example, a Meta-Constraint connector is drawn from ActualProjectMilestone to ProjectMilestone and the constraint is specified as classifier on the tag 'umlRole' in the connector's Tagged Values window.

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:

  • classifier – restricts the classifier for the source Stereotype element to the target Stereotype element
  • type – restricts the type for the source Stereotype element to the target Stereotype element
  • behavior - restricts the behavior for the source Stereotype element to the target Stereotype element
  • conveyed - restricts the conveyed element for the source Stereotype element to the target Stereotype element
  • slot - restricts the slot for the source Stereotype element to the target Stereotype element
  • client/source/end[0].role/informationSource – restricts the source of a connector to the target Stereotype element
  • supplier/target/end[1].role/informationTarget - restricts the target of a connector to the target Stereotype element
  • realizingConnector/realizingActivityEdge/realizingMessage - restricts the relationship that can realize an information flow
  • typedElement/instanceSpecification – when dropping as classifier from the Project Browser, this constraint restricts the type to the target Stereotype element
  • owner/class/activity/owningInstance – restricts the container of this element to the target Stereotype element; this constraint is used to create embedded element rules for the Quick Linker and validate nesting during Model Validation
  • ownedElement/ownedAttribute/ownedOperation/ownedParameter/ownedPort – restricts the element/attribute/operation/parameter/port that can be owned by the source Stereotype element; this constraint is typically used to validate nesting during Model Validation
  • annotatedElement/constrainedElement – restricts the target of a Note Link connector to the target Stereotype element
Constraints on Meta-Constraint connector

Stereotyped Relationship

A Stereotyped Relationship connector between two Stereotypes is used to specify a valid stereotyped connector between these two Stereotypes.

The Stereotype name should be set in the tag 'stereotype' on the Stereotyped Relationship connector.

Showing how the stereotyped relationship connector can be used to automatically create quicklinker definitions and model validation rules.

In the Profile example, a Stereotyped Relationship connector is drawn from ApplicationComponent to ApplicationEvent and the stereotype of the relationship is set to 'Assignment' in the connector's Tagged Values window.

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.

Note :

  • The value of the tag stereotype on the Stereotyped Relationship connector can be either a simple or a fully qualified connector stereotype

Learn More