1

I have a system with 3 states. I wanted to handle failures. That is, when the system reboots, it doesn't know the state it's in. Is the following state diagram correct?

enter image description here

Hossein
  • 1,152
  • 1
  • 16
  • 32

1 Answers1

0

This not a valid UML State Machine Diagram for several reasons:

  1. The start node is the wrong symbol. It should be a bullet.
  2. The arrows fork. Each arrow (transition) should begin and end on a node.
  3. The Y and N don't have square brackets.

Regarding the semantics:

  1. The decisions don't have meaningful text (should refer to previously stored state). They may be combined to one decision "storedState = " which has four outgoing transitions guarded as [S1], [S2], [S3] and [empty].
  2. The actions to store the state in persistent storage, in order to be restored in case of crash, are not present.
  3. In case all decisions yield N, the object is destroyed immediately, instead of ending in some default state.
  4. I don't understand the intention of A1, A2 and A3.

Perhaps it would be good to first show the diagram without reboot logic and then tell us what you try to add to that diagram to handle the failures.

www.admiraalit.nl
  • 5,768
  • 1
  • 17
  • 32
  • 1- I'll fix the aesthetics 5- The system doesn't store state in persistent storage, it checks on the determinations to figure out which state its in. 7- The A's are actions, – Hossein May 17 '19 at 17:07
  • The label of a transition arrow has format event[condition]/action, for example onRain[no umbrella]/run. Each of the three elements is optional. – www.admiraalit.nl May 17 '19 at 18:43