Adding state invariants to sequence diagrams

State invariants are runtime constraints, such as values of variables, attributes, and states, that are placed on the objects or capsules of an interaction. You can add state invariants to sequence diagrams to specify values or states.

About this task

To create a state invariant:

Procedure

  1. In the Palette, click State Invariant.
  2. In the interaction frame, click the lifeline to cover.
  3. In the dialog box that opens, verify the selected lifelines and click OK.
  4. Type a name for the state invariant and click OK.
    Tip: To change constraints to state invariants, in the diagram editor, right-click a constraint; then click Refactor > Refactor into State Invariant.

Feedback