Multiple messages on same line in a sequence diagram

+1 vote
asked May 25, 2017 in Closed question / help by anonymous
The feature for multiple notes on the same level has been implemented, but I would like to do the same for messages. Saves space when e.g.  messages are always sent via a broker, e.g. Alice only speaks to Sally via Bob:

@startuml
note over Sally : Scared of Bob
/ note over Alice : initial state of Alice
/ note over Bob : initial state of Bob
Bob -> Alice : hello
' The next line does not work with the /
/ Alice -> Sally : hello from Bob
@enduml

1 Answer

0 votes
answered May 25, 2017 by plantuml (182,960 points)

The syntax is not yet officially fixed (see http://plantuml.com/teoz )

However, using the Teoz version, you can have:

@startuml
!pragma teoz true
note over Sally : Scared of Bob
/ note over Alice : initial state of Alice
/ note over Bob : initial state of Bob
Bob -> Alice : hello
& Alice -> Sally : hello from Bob
@enduml

Once again, this is a beta, so do not hesitate to report issues here. And be aware that the syntax (/ and &) is probably going to be unified in some future.

Regards,

commented Dec 20, 2017 by anonymous
There is an issue if we are inside a group.
For example
@startuml
!pragma teoz true
group test
A -> B : hello
& B -> C : hi
end
@enduml
commented Jul 25 by Jean-Pierre Schnyder
Using participants, here's an example of command file:

@startuml

actor USER
participant TestSeqDiagBuilder
participant A
    /note over of A
        This is test class
        note for class A
    end note
participant B
    /note over of B
        This is test class
        note for class B
    end note
participant DSub
    /note over of DSub
        Short note DSub
    end note
    USER -> A: a13(a13_p1)
        activate A
        A -> B: b8(b8_p1)
            activate B
            B -> DSub: d2(d2_p1)
                activate DSub
                B <-- DSub: return Dd2Return
                deactivate DSub
            A <-- B: return Bb8Return
            deactivate B
        A -> B: b8(b8_p1)
            activate B
            B -> DSub: d2(d2_p1)
                activate DSub
                B <-- DSub: return Dd2Return
                deactivate DSub
            A <-- B: return Bb8Return
            deactivate B
        USER <-- A: return Aa13Return
        deactivate A
@enduml
...