Statechart Machines as Use Cases Elaborations

Recall that a use case describes a function performed by a system. The use case shows the primary and secondary actors that it interacts with as well as other use cases that it might interact with.

For example, a simple ATM machine has a three use cases:

We can elaborate each use case using a statechart diagram. In this case the states are often called wait states. In a wait state the system is waiting for a command or query response from an actor.

Here's a statechart for the transfer funds use case:

In fact, we can think of this statechart machine as a composite state in a larger statechart machine representing the entire system: