Applying constraints to UML model elements

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

  1. In the Project Explorer view or the diagram editor, right-click a model element; then click Add UML > Constraint. 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.
  2. In the parentheses, type a description of the constraint and press Enter.
  3. In the Properties view, click the General tab.
  4. On the General page, from the Language list, select a language.
  5. 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.

Feedback