1

I have an activity diagram below. enter image description here

I want to know if that kind of loop is correct. Is that "Waiting for the actor to stop listening to the music" a correct way to end the whole use case with that kind of ramification? And how that ramification should be described on the use case scenario? What number/index should every activity have?

JimmyJames
  • 24,682
  • 2
  • 50
  • 92

2 Answers2

3

Syntactically your diagram is correct.

From UML 2.5 p. 412:

15.7.3 ActivityFinalNode [Class]

15.7.3.1 Description

An ActivityFinalNode is a FinalNode that terminates the execution of its owning Activity or StructuredActivityNode.

So yes, once a token reaches the ActivityFinalNode at the bottom it will terminate the activity.


The fork will create two tokens. So the process on top continues and the Waiting action will trigger. Once the latter exits it reaches the ActivityFinalNode and that will, as described, terminate anything. Just the reset button being pushed.

Of course if the top Display action exits it will also push that reset button.

1

You might want to consider whether you would be better served with a state chart (the diagram for a UML state machine). There is a lot of overlap and often a use case can be expressed either way. In your case, your story has several locations where it is in a static condition ("Playing Music") where it is waiting for something to happen. That is a natural fit for a state chart. Activity diagrams are a more natural fit for a series of actions: "do this, then do that, then do the next thing."

Hope this helps!