Prev Next

Constraints

If you need to define the conditions and rules under which an element operates and exists, you can do this by setting Constraints on the element, in conjunction with its responsibilities (internal requirements). Typical constraints are pre- and post-conditions, which indicate things that must be true before the element is created or accessed and things that must be true after the element is destroyed or its action is complete.

To create the constraints on an element, you can use either the 'Constraints' tab of the Responsibilities window or the different 'Constraints' tab of the element's 'Properties' dialog. The Responsibilities window helps you to sketch out the element's constraints, and you can switch from there to the 'Properties' dialog to add detail to the constraint. Alternatively, you can create new constraints directly in the 'Properties' dialog.

You can show the constraints for an element directly on the diagram, using the element 'Compartment Visibility' function; this also reveals any constraints inherited from parent elements.

Information on using the Responsibilities window is provided in the Responsibilities Help topic. This Constraints topic goes on to discuss the 'Constraints' tab of the element's 'Properties' dialog.

Access

On a diagram or in the Browser, select an element and:

Ribbon

Design > Element > Editors > Constraints | Right-click on a constraint > Add New  or  Modify Selected

Design > Element > Editors > Properties Dialog > Constraints

Context Menu

Right-click on element | Properties | Responsibilities > Constraints | Right-click on a constraint > Add New  or  Modify Selected

Right-click on element | Properties | Properties > Constraints

Keyboard Shortcuts

Ctrl+4 > Constraints  (tab of the Responsibilities window)

Shift+Enter > Constraints ('Properties' dialog)

Shift+Alt+C  ('Properties' dialog)

Alt+9 > Constraints : Shift+Enter

Define constraints for an element

Option

Description

See also

Constraint (field)

Type the name or value of the constraint.

Type

Click on the drop-down arrow and select the appropriate type (Pre-condition, Post-condition, Process, OCL or Invariant).

Status

Click on the drop-down arrow and select the appropriate status.

Notes

Type in any additional details or comments on the constraint. You can format the notes text using the Notes toolbar at the top of the field.

Notes Toolbar

New

Click on this button to clear the fields ready to create a new constraint.

Save

Click on this button to save the constraint data.

Constraint (panel)

This field lists the constraints defined in the element, by name.

Delete

Click on a constraint in the 'Constraint' list and click on this button to immediately remove the constraint from the element.

(Up and Down Hands)

Up and down hand icons

(If you have two or more constraints in the element.) Click on a constraint in the 'Constraints' list and click on one of these buttons to move the constraint one position up or down in the list.

Learn more