State machine diagram is a behavior diagram which shows discrete behavior of a part of designed system through finite state transitions. State machine diagrams can also be used to express the usage protocal of part of a system. Two kinds of state machines defined in UML 2.4 are.