Search code examples
umlstate-machine

Regarding state machine diagram, if two actions trigger the same transition from a state, how should corresponding state transition table look like?


enter image description here

I am trying to convert this state machine diagram into its corresponding state transition table but I don't know what to write in the cell marked with question mark. Should I write both (a2/e2) and (a3/e3)?


Solution

  • Your table is a state transition matrix. You need in any case to show both alternative paths in the S2->S1 cell, i.e. a2/e2 and a3/e3.

    There is as far as I know no standard specification for such matrix. So any of the following should do:

    • separating the two transition rules, e.g. with a semicolon between the two transition rules or with an OR between the two (hint: comma separation might be confusing if you're sing the UML syntax, since it allows several comma-separated triggers for the same effect);
    • visualizing the two transition rules one above the other;
    • or splitting just this cell into two vertically stacked subcells.

    What you cannot do is to duplicate the whole line, since this would break the matrix. This technique only works with 1D state transition tables (i.e. each line correspond to one arrow)