I am in need of identifying all the basic elements of a UML 2.5 State Machine Diagram. Unfortunately , there seems to be a lot of ambiguity on the notation of those diagrams, as there are a lot of different variations online.
My interpretation is that every state machine diagram , consists of a number of states and a number of transitions.
Every state has:
- an optional entry action
- an optional do action
- an optional exit action
Every transition has:
- a triggering event,
- an optional precondition
- a transition action (post-condition).
My understanding of how the notation works can be summarized in Figure 1 (example of an electric door functionality following the notation [precondition] Event / [Transition Action]) and in Figure 2.
Example: When an event is triggered (e.g close button pressed), the precondition (if any) is evaluated (e.g is the doorway empty) and if the precondition is satisfied, a transition action (e.g close door) is triggered.
My questions:
- Is the Transition Action the realization of the transition or is simply an action that happens during the transition. In plain words, if the transition action/s go wrong, will the transition (new state) be successful? My question basically derives from the fact that a lot of sources suggest that instead of using a transition action, you can use an entry action when you arrive at the new state. In my understanding though a transition action is the realization of the transition and hence happens before entering the new state, in comparison to the entry action that happens immediately after arriving at the new state. So these are two completely different types of action in respect to the transition itself and time. It's crucial for me here to understand the timing of those actions.
- Is my general interpretation correct? (e.g. my understanding of what an event, post-condition and transition-action may be from Figure 1)
I know that there a dozen of variations of state machine diagrams, hence the different representations / interpretations but i am interested on the UML 2.5 one.