umlanalysisdiagramrequirementssystem-requirements

How to show interaction between two statuses on a diagram?


Imagine there are two statuses that an application is operating with, e.g. order status and shipment status.

When the order status is placed, the shipment status is blank. When the order status is "paid", the shipment status is "ready to ship". Then the shipment status is being changed to "assigned" through "shipped", "on delivery" and "delivered". Should the order status be set to "Cancelled" the "shipped" or "on delivery" shipment status is changed to "being returned" and then "received at the warehouse".

What is the best way to describe the interaction between the two statuses on a diagram?

I know two types of diagrams that could be utilized here, but both have drawbacks for the task:

  1. Activity Diagram - will perfectly describe the use cases, but is hard to read
  2. State Machine Diagram - can only describe one status, so there can be two state diagrams, but it won't be clear how the statuses interact with each other.

What would you recommend?


Solution

  • Your UML model contains two state machines. A UML model can be visualized by one or more UML diagrams. A UML diagram may visualize any subset of the UML model, or even the whole model (see UML specification version 2.5.1, Annex A). Therefore, it is allowed to show both state machines in one diagram.

    The dependencies between two state machines can be modeled in two ways:

    1. Using 'signal send symbols' in one state machine to send a message to the other state machine. The other state machine uses these messages by means of 'signal receipt symbols'. See figure 14.32 of UML spec 2.5.1.

    2. Using actions in one state machine and corresponding triggers in the other. This is the most convenient technique for your problem, as illustrated by the diagram fragment below. Actions are written behind a slash.

    two-machines-in-one-diagram