Duration constraint in Sequence Diagrams

+10 votes
asked Dec 2, 2014 in Wanted features by anonymous
Hello,

It would be great if we could add duration constraint to sequences diagram, as shown in the following examples:

http://www.uml-diagrams.org/sequence-diagrams/sequence-diagram-overview.png

http://d1dlalugb0z2hd.cloudfront.net/vpuml/tutorials/durationconstraint_screenshots/20101004/05-created-result.png

Syntax idea:

@startuml

duration D1 : "some time"
Alice -> Bob : start doing things during duration
Bob -> Max : something
Max -> Bob : something else
Bob -> Alice : finish
end duration D1

@enduml

Thank you

2 Answers

+1 vote
answered Feb 7, 2019 by flafla91 (140 points)
hello
It's really essential and we miss it
Thank you in advance

0 votes
answered Feb 15, 2019 by plantuml (294,960 points)

We added the notion of "anchor" in last beta http://beta.plantuml.net/plantuml.jar

With this last beta, you can have:

@startuml
!pragma teoz true

{start} Alice -> Bob : start doing things during duration
Bob -> Max : something
Max -> Bob : something else
{end} Bob -> Alice : finish

{start} <-> {end} : some time

@enduml

You define anchors using brackets.

This only works with the new "teoz" rendering engine. We won't make it work with the old default "puma" rendering engine because this one is too old and difficult to change.

Do not use too long text, because this kind of link has no impact on layout, so you can unfortunately have text overmap.

Please post any feedback, thanks!

commented Sep 19, 2019 by anonymous

Hi,

I think the proposal is fine for simple diagram.

But, for more complex one, the use of label / id in the code couldhelp.

for exemple :

@startuml
!pragma teoz true

{SomeLabel1} Alice -> Bob : start doing things during duration
Bob -> Max : something
Max -> Bob : something else
{SomeLabel2} Bob -> Alice : finish

{SomeLabel1} <-> {SomeLabel2} : some time

@enduml

Thanks for any comments
commented Sep 19, 2019 by plantuml (294,960 points)

Yes, your example is working fine.

Can we close this request ?

...