Slanted/crossing arrows in sequence diagrams

0 votes
asked Mar 19, 2019 in Wanted features by Dave Moon

The TEOZ feature of & to put two arrows in the same row is nice, but it doesn't handle the general problem.  Many people over the last six years have asked for sequence diagrams to allow arrows between different points in time, which would be rendered as slanted arrows.  I need this myself.  As far as I can tell there is no way to do this, whether using PUMA or TEOZ.

If you want a syntax suggestion, here is a very simple one:  append +N to an arrow specification to put the target N rows down, i.e. N steps later in time.  Also allow -N to put the target N rows up.

For example, if Alice and Bob concurrently send each other messages and the messages cross in the fabric, this description represents that situation and would render crossing arrows:

Alice -> Bob+1
& Bob -> Alice+1

It would be convenient, but not necessary, to allow a symbolic label for the destination row so authors don't have to count.

To me this seems easy to implement.  You just need to apply a rotation transform to the arrow line, the arrow head, and the attached text if any.

Let me know what you think.

commented Mar 25, 2019 by Medard
hello
do not forget the following:
according to the UML specification, an open arrow (->) means an asynchronous message. It would be nice if one could slant it.
also: according to the UML specification, an triangular arrow means a synchronous message
(-|>). These must not be slanted.

Further: there should absolutely be introduced the possibility to make time annotation on the live lines of objects, e.g. if one slants an asyncronous message or e.g. if one wants to show a timeout constraint.
commented Mar 27, 2019 by Dave Moon
A better syntax would be
```
event ::= [ "&" | "@" label ] participant arrow participant [ "color" color ] [ text ]
participant ::=  "[" | "]" | participantName [ "@" label ]
```

2 Answers

0 votes
answered Mar 20, 2019 by plantuml (295,000 points)

No, you cannot do this right now. Sorry about this.

Somehow, this feature is connected to the "anchor" that have been implemented recently (see http://forum.plantuml.net/2806/duration-constraint-in-sequence-diagrams )

A possible syntax would be something like :

@startuml
!pragma teoz true
{start} Alice -> Bob : start
Bob -> Max{start} : this arrow is slanted
Max{end} -> Bob : this arrow is also slanted
{end} Bob -> Alice : finish
@enduml

However, you'll have to be patient : the implementation is not that simple and we are working on many other features...

commented Oct 12, 2022 by albert (3,520 points)
Has there been any progress in this matter, see also https://stackoverflow.com/a/74038836/1657886 ?
0 votes
answered Oct 12, 2022 by The-Lu (64,340 points)

Hello all,

Has there been any progress in this matter, see also:

@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

or

@startuml
!pragma teoz true
A ->(50) C: Starts\nwhen 'B' sends
& B ->(25) C: \nBut B's message\n arrives before A's
@enduml

See the doc. on the sequence page:

Other Ref.:

Regards,
Th.

commented Nov 8, 2022 by kamilm (100 points)

Hi,

Is it possible to show that messages sent from one participant to the other were received in reversed order?

I mean something like this:

A sends msg1 to B

A sends msg2 to B

B receives msg2

B receives msg1

With current functionality the second message arrow may start after reception point of first arrow:

Or exactly in the same point as first message starts:

But how to make them cross?

Regards,

Kamil

...