A constraint definition defines a logical condition, and a constraint usage applies this condition in different contexts, enabling the reuse of the constraint definition throughout the system. The constraint usage is satisfied when its expression evaluates to true, and violated when it does not.

Creating constraint usage and definition elements

Creating constraint usage and definition elements via the Textual Editor

To create constraint usage and definition elements via the Textual Editor


  1. In the Textual Editor, place the cursor where you want to create the element and declare the keyword:
    1. constraint def for a constraint definition.
    2. constraint for a constraint usage.
  2. Specify the element name.
  3. Specify the constraint (expression, attributes, etc.) in the element's body.
  4. Click the Synchronize button.

constraint def MassLimit {                                                                              // constraint definition
    attribute mass : MassValue;
    attribute massLimit : MassValue;
    mass <= massLimit
}

part vehicle {
    attribute massActual : MassValue;
    attribute massRequired : MassValue;

    constraint massConstraint { massActual <= massRequired }                     // named constraint usage
    constraint { massActual <= massRequired }                                               // unnamed constraint usage

}

Creating constraint usage and definition elements via the Create Element command

To create constraint usage and definition elements via the Create Element command


  1. In the Containment tree, right-click an element, and in the shortcut menu, click Create Element.

  2. In the Create Element dialog, select one of the following:
    1. constraint def to create a constraint definition element.
    2. constraint to create a constraint usage element.
  3. Name the element.
  4. Specify the constraint (expression, attributes, etc.).

Creating constraint usage and definition elements via the view palette

To create constraint usage and definition elements via the view palette


  1. In the view palette, under the Requirements/Constraints group, click one of the following:
    1. The constraint def button to create a constraint definition element.
    2. The constraint button to create a constraint usage element.
  2. Click in the view pane where you want to create the constraint.
  3. Specify the constraint (expression, attributes, etc.).

Auto-creating constraint definition elements via the Extract Definition commands

To auto-create constraint definition elements via the Extract Definition commands