Reputation: 71
Overview: This is my activity diagram for the stock management subsystem. I have 3 actors which are the admin, manager, and employee.
Question: Can someone explain to me how can I do my sequence diagram with 3 actors? In my sequence diagram, I need to have interface and controller (primary) not just the entity classes.
Note: I already made the sequence diagram for each of the actors but I don't know how to combine its kinda complicated lol.
Upvotes: 1
Views: 1479
Reputation: 73530
Sorry for being provocative, but this is a misunderstanding: actors are by definition external to the system:
UML 2.5.1, section 18.1.3.1: A subject of a UseCase could be a system or any other element that may have behavior, such as a Component or Class. (...)
An Actor models a type of role played by an entity that interacts with the subjects of its associated UseCases. Actors may represent roles played by human users, external hardware, or other systems.
In your activity diagram, you modelled activities of the sytem and grouped those activities in partitions ("swimlanes"). These partitions may somehow be related to actors, but they are not themselves actors. It's just a (visual) grouping:
UML 2.5.1, section 15.6.3.1: An ActivityPartition is a kind of ActivityGroup for identifying ActivityNodes that have some characteristics in common.
Likewise a sequence diagram is meant to represent interactions within the system:
UML 2.5.1, section 17.2.3.1: interactions are units of behavior of an enclosing Classifier.
As a direct consequence, you should in principle not show actors in a sequence diagram, since they are external to the system and not enclosed in the system, a subsystem or a class thereof. It's however a common and tolerated practice (although ambiguous):
Typically, activity diagrams with regions are a convenient way to document workflows with several actors. If you want to really focus on actors in compelx workflows, a better alternative would proabably be to use BPMN, which is designed for business process modeling.
Upvotes: -1