In
UML models, you can apply constraints to model elements to indicate that the
constraints impose a condition or restriction on the model elements.
About this task
To apply a constraint to a model element:
Procedure
- In the Project Explorer view or the diagram
editor, right-click a model element; then click . The
new constraint appears as an empty set of braces in the Project
Explorer view, and if you added the constraint to an element in
the diagram editor, the constraint also appears as a red text box in the diagram.
- In the parentheses, type a description of the constraint and press
Enter.
- In the Properties view, click the General tab.
- On the General page, from the Language list,
select a language.
- In the Value field, type the body of the
constraint. The statement should be a Boolean expression and yield
a true value when evaluated for the model to be well formed.