Guards

A guard is a Boolean condition that may or may not validate the triggering of an event occurrence.

Guards make it possible to maintain the determinism of a state machine, even when many transitions can be triggered by the same event. When the event takes place, guards — which must be mutually exclusive — are evaluated, and then a transition is validated and triggered. In the following example, when it is too warm, guards make it possible to start the air conditioning or simply to open the windows, according to the season.

© 1997 Editions, Eyrolles, Paris, France . All rights reserved.