Introduction
The Unified Modelling Language (UML) is a modelling language that can be used for a variety of purposes. The primary goal of UML is to define a standard way to visualise how a system was designed. Moreover, it is a visual language, not a programming language. They are used to depict the behaviour and structure of a system. UMLs are very similar to blueprints, which are used in other engineering fields.

There are two types of UML diagrams-
- Structure Diagrams- These diagrams model the structure or static aspect of the system. Examples of structural diagrams are class diagrams, object diagrams, package diagrams and deployment diagrams.
- Behaviour Diagrams- These diagrams model the behaviour or dynamic aspect of the system. They simply guide us through the system’s functionality. Examples of behaviour diagrams are state diagrams, class diagrams, activity diagrams and interaction diagrams.
This article will discuss state diagrams in detail.
What is State Chart Diagram?
The state diagram is a behaviour UML diagram. So, it depicts the behaviour or dynamic aspect of a system. By dynamic aspect, we mean that a state diagram represents the state or condition of a system at a finite instance of time. These diagrams are also known as state machine diagrams or state chart diagrams.
Now, let’s dive deep into the state diagram.
Components Of A State Chart Diagram
Following are the components of a state diagram-
- Initial State- Initial state represents the starting point of the state diagram. A black filled circle represents it.
2. State - State represents the condition of a system at a finite instance of time. A rounded rectangle represents it.
3. Transition - Transition represents a change in control from one state to another caused by the occurrence of an event. A solid arrow represents it.
4. Decision box - The decision box represents the decisions that will be made based on an evaluated guard. A diamond shape represents it.
5. Fork - A fork represents a state splitting into two or more concurrent states. It is represented by a rounded rectangular solid bar with arrows incoming from the parent state and towards the concurrent states.
6. Join- A join represents two or more states converging into one state. It is represented by a rounded rectangular solid bar with arrows that are incoming from the concurrent states and towards the common state.
7. Self Transition- Self transition represents the scenarios when the state of an object does not change upon the occurrence of an event. It is represented by a solid arrow pointing to the state itself.
8. Composite State- Composite state represents a state having internal states or nested states. It is also represented by a rounded rectangle like the state component.
9. Final State- Final state represents the ending point of the state diagram. Two concurrent circles represent it, with the inner circle filled with black colour.
After the components, let’s see the steps to draw a state diagram.