Sequence diagram: crossed arrows

+5 votes
asked Jun 17, 2013 in To be sorted by anonymous
Hello

Is it possible to draw crossed arrows in a sequence diagram? I'm working on workflows involving crossing of messages to express race conditions, something like:

S1 sends a message to S2

At the same time, S2 sends a message to S1

 

I'm not sure if it follows the UML standards but this is allowed by tools like MS Visio or Rational

Thanks in advance

Manu
commented Jul 16, 2018 by albert (3,540 points)
edited Aug 4, 2018 by albert
See also http://forum.plantuml.net/7884/non-instantaneous-activities

Interesting especially in the light of e.g. asynchronous communication (MPI).
I doubt that it is possible as it is a SEQUENCE diagram.

2 Answers

0 votes
answered May 23, 2022 by The-Lu (74,900 points)

Hello A. and all,

See some new enhancements [on V1.2022.6beta] about this topic, here:

Here is a first proposal (Thank to PlantUML team):

@startuml
!pragma teoz true

S1 ->(30) S2: msg 1\n
& S2 ->(30) S1: msg 2

note left S1: msg\nS2 to S1
& note right S2: msg\nS1 to S2
@enduml

If that can help,
Regards.

0 votes
answered Aug 12, 2022 by luckyman (140 points)
Hi team,
I want to concatenate arrow in sequence diagram (msg1 and msg2 in my example), however 2 bugs found:
1. the text msg1 and msg2 are nto aligned vertically.
2. if the diagrame contains pages, then there will be strange things appearing in pages.
Regards,
Lucky

my code:

@startuml
!pragma teoz true

title test
s1->s2 ++: req
    s2->s3 ++: fwd
    return
return resp

newpage test1
s1->s2 ++: req
    s2->s3 ++: fwd
    return
return resp

s1 ->o s2: msg 1 \n
& s2 -> s3: msg 2

@enduml
...