Search code examples
umlstatefulstatechartstate-diagram

action as state in UML state diagram


In this video a part of an UML state chart can be seen :

enter image description here

However, the "provide funds" state is an action. How does that make sense ?

Is it possible for a state to be an action (verb) ?

Should the "provide funds" action not be rather a transition ?

Would something like this below not make more sense ?

enter image description here


Solution

  • Provide Funds in this case is also a state with the same name as an action. So they are not identical. They just have the same name. Sometimes it's hard to avoid this situation. From the modeling perspective I would say this state is simply superfluous. You could do self-transitions from Funds Available while funds are > 0 and simply exit when fund gets zero.

    P.S. Oh, I see your last picture is exactly what I said :-)

    1. So basically the [funds avail >$0] transition gets automatically triggered after the Provide Funds action completes?

      Yes and no. [funds avail >$0] is a guard. The trigger is request fund. This transition will only be performed if the guard won't block (so if money is available).

      So this is some kind of a "transient" state? So to say.

    2. Also, do I get it right that the state while providing funds is also called Provide Funds (not just the the action)? So a better name for the state would be : the state of the machine while providing funds ?

      Exactly.