State diagram (Statechart Diagram):
Describes all possible states of a particular object and the events that cause state transitions.
Not all classes need to use a state diagram to describe its behavior, and only those classes that have important interaction behaviors are described using a state diagram.
Composition
state: also known as an intermediate state, represented by a rounded rectangle, which can have more than one state in a state diagram, each state containing two squares: the top placement state name, and the following, which describes the activity (action) that the object can make while in that state.
initial states (Initial State): also known as the initial state, is represented by a black solid circle, which can only have one initial status in a state diagram.
End state: also known as a terminating or ending state, with a solid circle and a circle, there may be multiple end states in a state diagram.
Transfer (Transition): use lines and arrows from one state to another to describe the state of transition, and use text to explain what the corresponding event is causing the state to change. Events are likely to occur under certain conditions,
In UML, such a condition is called a daemon (guard Condition), and the processing when an event occurs is also known as an action (action). Transitions between states can be labeled with three parts (each part can be omitted) with the syntax: event name [condition]/action name.
State diagram (Statechart Diagram)