I ever made an activity diagram to represent a use case with 3 actors. I made a swimlane for each actor, so I have 3 swimlanes in an activity diagram. But my lecturer said that it was wrong because I should have more activity diagrams. He meaned that an activity diagram based on one bubble (use case) in use case diagram, not based on actor. However I browse more, then I found that my lecturer's words should be a sequence diagram, not activity diagram. So what's the true statement? My first activity diagram or my lecturer words?
4 Answers
Your instructor is right:
- Use-case diagrams are about what the systems has to offer to fulfil the requirements. Each use-case correspond to a set of behaviors that may be performed in interaction with the actors for helping them achieving their goals.
- The activity diagram is about how the system performs elementary behaviors, or more complex sets of behaviors
Use-case isn't about the internals of the system. It's about its purpose and main relation with the outside world. There is absolutely no sequential order between the use-cases shown in such diagram. A user may read it and get an answer to the question "what's in for me?".
Activity is on contrary not about the outside world and not about actors. It's about the internals of the system: its internal flows, which follow an order that can be deduced from the control and dataflow semantics. A developer may read it and get an answer to the question "How shall this work?"
If you know that certain activities are performed in interaction with certain actors, and if you think it's important, you may communicate this knowledge in the model with an activity partition, graphically represented as a “swimlane”. But be aware that partitions are not intended for being mapped to actors or other elements of the environment. Partitions allow to visually group activity nodes that have some characteristics in common. They are typically used to highlight which component or class is doing what.
In conclusion, there is not necessarily a direct mapping between activity and use-cases, since they represent different realities. However, if such a mapping exist, it's at least one activity diagram per use-case (bubble).
P.S: Slightly edited to avoid any confusion in the terminology: “swimline” is a non-UML term coming from process modeling, that describes a graphical layout, and “partition” is a subdivision of an activity diagram in the model

- 68,716
- 7
- 72
- 138
-
@GeertBellekens Thank you for your two justified remarks. 1) I purposely used both words: the “partition” for making OP familiar with the UML terminology, and the “swimlane” because it’s what OP knows so he/she can connect the dots, and because the swimlane is visual terminology. By the way, both are not mutually exclusive: UML2.5 use “swimlane” 4 times on page 406 to describe how to draw a partition ;-). – Christophe Jun 24 '20 at 08:24
-
I hadn't searched the specs for the word "swimlane". In Sparx there is a non-UML concept of swimlane, that is purely visual, and the UML concept of ActivityPartition, which is actually part of the model. – Geert Bellekens Jun 24 '20 at 08:27
-
@GeertBellekens 2) “Informal” may be inappropriate. However I think that the partition is left to the choice of the modeler,according to section 15.6.3.1 “...is a kind of ... for identifying ActivityNodes that have **some characteristics in common**”. I think that “interacting with a kind of actor” is a valid characteristic, even if it would not be my first personal choice. If an EBC is considered, each interaction of a use case with a different actor would btw correspond to a different classifier, which is a valid partitioning as well. But if I missed something, I’m ready to edit:-) – Christophe Jun 24 '20 at 08:31
-
@GeertBellekens: `ActivityPartitions` actually cannot own the nodes. They only reference them. They are part of the model and as such they are not "informal". However, the semantics is not well defined, and therefore one could argue, that they are in a way informal. Of course there are combinations of represented elementtype and actiontype where there are defined formal semantics. – Axel Scheithauer Jun 25 '20 at 11:30
-
@AxelScheithauer Yes, indeed, you are right. The relation between the ActivityPartition and the ActivityNodes and edges is called *Contained*, but both the ActivityPartition and the edges and nodes should be owned by the Activity. There is even an explicit constraint that says so. Seems like Sparx has implemented this wrong by forcing the nodes to be owned by the ActivityPartition. – Geert Bellekens Jun 25 '20 at 11:48
-
@GeertBellekens Swimlane is in fact ambiguous because it describes as well a graphical layout, as well as a family of process diagrams that make intensive use of that layout. I edited to avoid any confusion, and replace the unfortunate “informal” with a formulation in line with the UML specs. – Christophe Jun 25 '20 at 12:20
-
@AxelScheithauer Thank you Axel for your remark. Indeed “informal” for something that is formalized in a model, is not the appropriate formulation. I edited that paragraph accordingly. – Christophe Jun 25 '20 at 12:22
Activity diagrams don't have actors.
They are meant to show the message flow from one activity (use case) to another. You can read more details about this here.
The activity diagram serves the following main purposes, it:
- draws the activity flow of a system,
- describes the sequence from one activity to another, and
- describes the parallel, branched, and concurrent flow of the system.

- 3,137
- 2
- 10
- 26
There is no one way to specify a use case. UML doesn't describe how to do it. Therefore, many authors have different ideas on how to do it. So, your idea to use partitions (you called them swimlanes) to represent Actors is valid, as long as it helps you to communicate the use case to your stakeholders.
However, that doesn't help you, when your lecturer has a different opinion. He or she might have good reasons for this statement. Probably it worked well in the situations he or she experienced.
Some authors suggest to use interaction diagrams. Since a use case describes how actors use a system, in other words, how they interact with it, this could be a good choice. The problem here is, that most people only know sequence diagrams of interactions, and they are not well suited to describe all the different ways the use case goal can be reached.
Therefore, many people use activity diagrams, even though officially they can't describe the interaction between actors and the system. They are in fact meant to describe the inner workings of a system (that could of course also be a system of people). So, your activity diagram officially means, that the activity invokes behavior at the actors. I don't think that was what you had in mind.
Since many people nevertheless use activity diagrams for describing use cases, I think your interpretation of partitions is not so far off. I personally think, partitions make live of the modeler unnecessarily more difficult and would not use them.
If you choose to use activities to describe use cases, it should be one activity per use case.

- 2,758
- 5
- 13
-
Interesting. Just a practical question: suppose OP has a use-case diagram with 3 or 4 independent use-cases; how would you model these in a single activity diagram, when there is no established sequence between the UC? Is it allowed to have several initial nodes that are not fired in the same time? – Christophe Jun 25 '20 at 18:11
One use Case represent a single feature of the system but does not show the process involved to fulfill the requirement, to show the process involved we use the activity diagram.

- 11
-
As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 27 '22 at 01:00
-
I'm so surprised getting ur answer. It has a long time since I wrote this question when I was a college student lol. Now I've worked as db engineer, but thank u so much. – Mey Lin Apr 07 '22 at 04:37