Prev Next

Constraints on Meta-Constraint connector

When creating a domain-specific Profile, Enterprise Architect allows you to specify constraints between related Stereotypes. As an example, you can restrict the element that can be set as a classifier on a Stereotyped element.

A Meta-Constraint connector, on the 'Metamodel' page of the 'Profile' toolbox, between two Stereotypes is used to specify the constraint between the two Stereotypes. The constraint should be set in the tag 'umlRole' on the Meta-Constraint connector.

Access

Ribbon

Design > Diagram > Toolbox: > Profile > Metamodel

Keyboard Shortcuts

Alt+5

Constraint values for tag 'umlRole'

Constraint values for the tag 'umlRole' on the Meta-Constraint connector are:

Constraint

Description

See also

classifier

Set this constraint to restrict the classifier for the source Stereotype element as the target Stereotype element.

In the Profile example, a Meta-Constraint connector is drawn from the stereotype ActualCondition to Condition and the constraint is specified as 'classifier' on the tag 'umlRole' in the connector's Tagged Values window. This means that only a 'Condition' stereotyped element can be set as the classifier for an ActualCondition stereotyped element.

After importing this Profile into a model, Enterprise Architect will show only Condition stereotyped elements in the 'Select DataType' dialog when setting the DataType for an ActualCondition stereotyped element.

Select Dialog

type

Set this constraint to specify the type for the target Stereotype element when it is dropped from the Project Browser into a diagram while pressing and holding the Ctrl key.

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

After importing this Profile into a model, when a Capability stereotyped element is dropped from the Project Browser into a diagram while pressing and holding the Ctrl key,  the 'Paste <item>' dialog will display CapabilityProperty as one of the options in the 'Drop as' list.

Drop Elements from Project Browser

behavior

Set this constraint to restrict the behavior for the source Stereotype element to the same as the target Stereotype element.

In the Profile example, a Meta-Constraint connector is drawn from stereotype FunctionAction to Function and the constraint is specified as 'behavior' on the tag 'umlRole' in the connector's Tagged Values window. This means that only a 'Function' stereotyped element can be set as classifier for a FunctionAction stereotyped element.

After importing this Profile into a model, Enterprise Architect will show only Function stereotyped elements in the 'Select Activity' dialog when setting the behavior for a FunctionAction stereotyped element.

Select Dialog

conveyed

Set this constraint to restrict the Information Items that can be conveyed on a Stereotype that extends the Information Flow connector.

In the Profile example, a Meta-Constraint connector is drawn from stereotype OperationalExchange to OperationalExchangeItem and the constraint is specified as 'conveyed' on the tag 'umlRole' in the connector's Tagged Values window. This means that when an OperationalExchange connector is drawn, the Information Items that can be conveyed on the connector are restricted to OperationalExchangeItem stereotyped elements.

Convey Information on a Flow

slot

Set this constraint to restrict the slot for the Stereotype element as the target Stereotype element.

In the Profile example, a Meta-Constraint connector is drawn from the stereotype ActualProject to ActualProjectRole and the constraint is specified as 'slot' on the tag 'umlRole' in the connector's Tagged Values window. Note that the stereotype 'ActualProject' extends UML Object and can classify stereotype 'Project'. When an instance specification for the Project element is created (by dropping it from the Project Browser into a diagram while pressing and holding the Ctrl key) in the model:

  • The created instance specification will be stereotyped ActualProject
  • Any Property in the 'Project' stereotyped element will be created as an 'ActualProjectRole' stereotyped Property in the instance specification

client/
source/
end[0].role/
informationSource

Set this model validation constraint to restrict the start element of a Stereotyped connector.

In the Profile example, a Meta-Constraint connector is drawn from stereotype 'FunctionControlFlow' to FunctionAction and the constraint is specified as 'source' on the tag 'umlRole' in the connector's Tagged Values window. This means that when a FunctionControlFlow connector is drawn, the source element should be a FunctionAction stereotyped element. Else, Enterprise Architect will flag an error when performing a Model Validation.

Model Validation

supplier/
target/
end[1].role/
informationTarget

Set this model validation constraint to restrict the target element of a Stereotyped connector.

Model Validation

realizingConnector/
realizingActivityEdge/
realizingMessage

Set this constraint to restrict the relationship that can realize an Information Flow connector.

In the Profile example, a Meta-Constraint connector is drawn from stereotype OperationalExchange (which extends a UML InformationFlow metaclass) to OperationalConnector and the constraint is specified as 'realizingConnector' on the tag 'umlRole' in the connector's Tagged Values window. This means that when an OperationalConnector connector is drawn, the Information Flow connector that can be realized on this connector can be an OperationalExchange stereotyped connector.

Realize an Information Flow

typedElement/
instanceSpecification

When dropping as classifier from the Project Browser, this constraint restricts the available type to the target Stereotype element.

owner/
class/
activity/
owningInstance

Set this constraint to restrict the container/owner of the element to the target Stereotype element. This constraint is used to create embedded element rules for the Quick Linker and to validate nesting during Model Validation.

In the Profile example, a Meta-Constraint connector is drawn from the stereotype DataElement to DataModel and the constraint is specified as 'owner' on the tag 'umlRole' in the connector's Tagged Values window. This means that DataElement stereotyped elements can be children of DataModel stereotyped element. In other words, only DataModel can contain/own DataElements in the Model.

Model Validation

ownedElement/
ownedAttribute/
ownedOperation/
ownedParameter/
ownedPort

Set this constraint to restrict 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.

In the Profile example, a Meta-Constraint connector is drawn from stereotype ProjectMilestone to ProjectTheme and the constraint is specified as 'ownedAttribute' on the tag 'umlRole' in the connector's Tagged Values window. This means that ProjectMilestone stereotyped elements can contain 'ProjectTheme' stereotyped attributes in the model.

Model Validation

annotatedElement/
constrainedElement

Set this model validation constraint to restrict the target of a NoteLink connector.

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

When the Profile is imported into a model, the target of a NoteLink connector from a SecurityControlFamily stereotyped element should be a SecurityControl stereotyped element. Else, Enterprise Architect will flag an error when performing a Model Validation.

Model Validation

Learn More