Sequence diagram: long-running action (slanted arrow)

0 votes
asked Aug 10, 2023 in Question / help by IvanR (140 points)

Is it possible to represent a long-running action (or a delay, for example due to network latency) using slanted arrows? 

Given this diagram:

@startuml
!pragma teoz true

Alice -> Bob: msg1
Bob ->(80) Alice: msg2

Bob -> Carol: msg3
Carol -> Bob: msg4
@enduml

I would like to make it so that "msg3" and "msg4" are both sent and received AFTER "msg2" was SENT but BEFORE "msg2" has arrived to Alice.

commented Aug 10, 2023 by IvanR (140 points)

1 Answer

–1 vote
answered Aug 10, 2023 by EGR

Dear IvanR:

Strictly in UML, you can write:

@startuml
!pragma teoz true
skinparam style strictumlAlice -> Bob: msg1
note left: Synchronous message\n(The next message should be execute after complete this message)
Bob ->> Alice: msg2
note left: Asynchronous message\n(maybe have a delay to be complete)
Bob -> Carol: msg3
note left: Synchronous message\n(can be execute after msg1 is completed and after msg2 is begin)
Carol -> Bob: msg4
@enduml

Regards

commented Aug 10, 2023 by IvanR (140 points)

@EGR, the final result of what you are proposing doesn't get even close to what the question is asking:

I don't have anything against the notes, but IMO the whole point of using diagrams is to capture and share information visually. In this case lack of control over arrow start and end times limits author's ability to effectively communicate complex sequence scenarios.

commented Aug 10, 2023 by EGR
edited Aug 10, 2023

Dear IvanR:

The notes are for interpretation of this particular example only.
The proposal is based on the semantics of synchronous and asynchronous messages in the UML.
Here the complete example:

@startuml
!pragma teoz true
Alice -> Bob: msg1
note left: Synchronous message\n(The next message should be execute after complete this message)
Bob ->>(80) Alice: msg2
note left: Asynchronous message\n(maybe have a delay to be complete)
Bob -> Carol: msg3
note left: Synchronous message\n(can be execute after msg1 is completed and after msg2 is begin)
Carol -> Bob: msg4
@enduml

Regards

commented Aug 10, 2023 by anonymous
@EGR, I understand what you are proposing. The problem is that your proposal does not describe a single possible scenario, but rather a range of possible scenarios (hence the use of words such as "should", "maybe" and "can"). I am looking for a way  to capture just one of the possible scenarios in a single diagram.

In any case, thank you for taking your time to respond.
...