3

I have a PlantUML sequence diagram where Alice exchanges messages with Cecil once and then only the communication with Bob happens. This flow causes the subjects are ordered by the time of their first interaction.

@startuml
Alice -> Cecil: hi
Cecil -> Alice: fu

Alice -> Bob: hi
Bob -> Alice : hello

Alice -> Bob: howdy?
Bob -> Alice: fine

Alice -> Bob: r u sure?
Bob -> Alice: ye
@enduml

enter image description here

It looks ugly - I want to avoid showing the interaction between Alice and Bob over Cecil.

How to assure a custom order of the subjects, i.e. Alice - Bob - Cecil?

Nikolas Charalambidis
  • 40,893
  • 16
  • 117
  • 183

1 Answers1

11

I have found it out. Just use the keyword, participant. The order of generated participants follows the order of their definitions. Alternatively, it is possible to define the order explicitly (participant Alice order 1).

Source: UML Sequence Diagram: Participants

@startuml
participant Alice
participant Bob
participant Cecil

Alice -> Cecil: hi
Cecil -> Alice: fu
Alice -> Bob: hi
Bob -> Alice : hello
Alice -> Bob: howdy?
Bob -> Alice: fine
Alice -> Bob: r u sure?
Bob -> Alice: ye
@enduml

enter image description here

Arvind Kumar Avinash
  • 71,965
  • 6
  • 74
  • 110
Nikolas Charalambidis
  • 40,893
  • 16
  • 117
  • 183