How can I place a note over each participant in a sequence diagram such that all notes are on the same line?

0 votes
asked Jul 31, 2019 in Question / help by John R. Wolfe
I am generating input for the PlantUML sequence diagram tool from an execution log and using notes (specifically "rnote") to represent the state of each participant in a sequence diagram.  When a message causes a transition in the recipient, a note containing the new state name is emitted after the message:

"Fred" --> "Barney" : Hey

rnote over "Barney" : Awake

Now, I am trying to work out how to emit a collection of notes, one for each participant, such that all notes in the collection appear on the same horizontal line (time slot) so that I can show the initial state of each participant at the top of the sequence diagram, just below the name of each participant.

participant "Fred"

participant "Barney"

rnote over "Fred" : Shouting; rnote over "Barney" : Asleep

Is it possible to arrange for a collection of notes to appear on the same line?  If so, what is the syntax?

1 Answer

+1 vote
answered Jul 31, 2019 by plantuml (295,000 points)

It is possible using the new "teoz" layout engine:

@startuml
!pragma teoz true
participant "Fred"
participant "Barney"
rnote over "Fred" : Shouting
& rnote over "Barney" : Asleep
@enduml

http://www.plantuml.com/plantuml/uml/LOsn3S9G34HxJs5IC0HLe6019h38ANmfiIt77mccnqKAqhxtJZTkAP5zNUZa8VCgdB0lPtIGbsdFvgB9mpqm3NHaDmd5fsYe9TZUY3ta2pzUrhFfJ6V-r_kcWkks04uZTAh_7m00

Is this what you are looking for ?

Note that this layout engine is still under test, so please report any issue you'll find. Thanks!

commented Jul 31, 2019 by John R. Wolfe
Yes, this is exactly what I need.

Thank you so much for the rapid response.
...