19.7. Guard

A guard is associated with a transition. At the time an event is dispatched, the guard is evaluated, and if false, its transition is disabled. In the UML metamodel, Guard is a child of ModelElement.

A guard is shown on the diagram by the text of its expression in square brackets ([]).

19.7.1. Guard Details Tabs

The details tabs that are active for guards are as follows.

ToDoItem

Standard tab.

Properties

See Section 19.7.2, “Guard Property Toolbar” and Section 19.7.3, “Property Fields For Guard” below.

Documentation

Standard tab.

Source

Standard tab, containing the expression for the guard.

[Note]Note

In the fullness of time this tab will contain code to implement the guard. This is not implemented in the current release of ArgoUML.

Constraints

Standard tab. ArgoUML only supports constraints on Classes and Features (Attributes, Operations, Receptions, and Methods), so this tab is grayed out.

Tagged Values

Standard tab. In the UML metamodel, Guard has the following standard tagged values defined.

  • derived (from the superclass, ModelElement). Values true, meaning the guard is redundant—it can be formally derived from other elements, or false meaning it cannot.

    [Note]Note

    Derived guards still have their value in analysis and design to introduce useful names or concepts, and in design to avoid re-computation.

[Note]Note

The UML Element metaclass from which all other artifacts are derived includes the tagged element documentation which is handled by the documentation tab under ArgoUML

19.7.2. Guard Property Toolbar

Go up

Navigate up through the package structure.

Delete

This deletes the guard from the model

[Warning]Warning

This is a deletion from the model, not just the diagram.

19.7.3. Property Fields For Guard

Name

Text box. The name of the guard. By convention guard names start with a lower case letter and use bumpy caps to divide words within the name.

[Note]Note

ArgoUML does not enforce this naming convention.

Stereotype

Drop down selector. Guard has no stereotypes by default in the UML standard.

Navigate Stereotype

icon. If a stereotype has been selected, this will navigate to the stereotype property panel (see Section 15.4, “Stereotype”).

Namespace

Text box. The namespace in which the guard is defined.

Transition

Text box, showing the transition that owns this guard.

Button 1 double-click on the transition navigates to that transition.

Expression

Text box. The expression that defines the guard.

Language

Text box. It may be useful to indicate that the expression is written in a particular interpretation language with which to evaluate the text.