I am writing my first state diagram for an approvals matrix and I am stuck. An Order in our system will go through a number of states and transitions for approval:


  • Start (state)
  • (submit() transition)
  • Awaiting Approval (state)
  • (approve() transition)
  • Awaiting Approval (state)
  • (approve() transition)
  • ...
  • Live (state)

My problem is that the awaiting approval states will only transition to Live state when N number of approve() events, for each order, are received (an approval from one user will trigger a notification for approval from another user).

Should I add a decision point after the Awaiting Approval state that does a self transition back to Awaiting Approval OR progresses to Live state based on a count of approvals (is that allowed? Or am I missing something?)

Any help would be appreciated. Most state diagrams I look at are based on a set number of approvals, not a variable list.


If the approvals come in a predetermined order (as the order walks its way up the food chain), you could show separate states for AwaitingApprovalFromClerk, AwaitingApprovalFromSuperClerk, AwaitingApprovalFromJuniorBeanCounter, AwaitingOrderFromSeniorBeanCounter, up through AwaitingApprovalFromCEO and AwaitingApprovalFromCEOMotherInLaw. This would make it obvious to the audience that the company had a problem.

If the approvals come in no particular order, you set up an additional predicate on the transition AllNeededApprovalsInHand?, and the AwaitingApproval state gets a self-loop conditioned on the predicate being false, as well as the transition to Live conditioned on the predicate being true. Then you add a big comment block, attached to the self-loop, that talks about the myriad mandatory approvals.

  • 1
    Remember, UML is allowed to be vague and ambiguous. Apr 22 '18 at 17:50
  • Thanks a lot John - the second option sounds good. I wasn't sure if you could put decision points on self loops, you see. But I suppose, why not.
    – Sico
    Apr 22 '18 at 17:57
  • ...and I'll hold fire on the company approval strategy :)
    – Sico
    Apr 22 '18 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.