The following example provides an overview of the base features that the state machines defined in this specification will support. In the following, a more complex example is given, that also supports sub-state machines.
Figure 1gives an overview over a simple state machine. It contains the three states "State1", "State2" and "State3". There are transitions from "State1" to "State2", "State2" to "State2", etc. Some of the transitions provide additional information with regard to what causes (or triggers) the transition, for example the call of "Method1" for the transition from "State1" to "State2". The effect (or action) of the transition can also be specified, for example the generation of an Eventof the "EventType1" in the same transition. The notation used to identify the cause is simply listing it on the transition, the effect is prefixed with a "/". More than one cause or effect are separated by a ",". Not every transition has to have a cause or effect, for example the transition between "State2" and "State3".
For simplicity, the state machines described in this specification will only support causes in form of specifying Methodsthat have to be called and effects in form of EventTypesof Eventsthat are generated. However, the defined infrastructure allows extending this to support additional different causes and effects.
Figure 2shows an example of a state machine where "State6" is a sub-state-machine. This means, that when the overall state machine is in State6, this state can be distinguished to be in the sub-states "State7" or "State8". Sub-state-machines can be nested, that is, "State7" could be another sub-state-machine.