Multiple threads / activations

+1 vote
asked Jan 30, 2015 in Wanted features by anonymous
retagged Feb 2, 2015 by plantuml

Is this possible? I would like to create a sequence diagram with this structure:

multi threaded diagram

The closest I've been able to create with PlantUML is this:

PlantUML appoximation

using this code:

@startuml
User ->> A ++ #red : start
create B
A -> B ++ #red: new
User -> Pkg ++ : func
B -> Pkg ++ #red : func
Pkg --> User --
Pkg --> B --
B --> A --
deactivate A
@enduml
 
Thanks

1 Answer

0 votes
answered Feb 2, 2015 by plantuml (294,960 points)
Hello,

This is not possible with current version.

However, we are currently refactoring sequence diagrams (see http://plantuml.sourceforge.net/teoz.html ), and this may be possible with the new layout engine.

However, we would need a clear and neat syntax for this, so any ideas/suggestions on this syntax is welcome!

Regards,
commented Jan 19, 2016 by anonymous
Hi,

I think, a simple syntax would be as follows, where different aliases are possible:

create "Name shown" as t1, t2

With this syntax, the example can be written:

@startuml
User ->> A ++ #red : start
create B
A -> B ++ #red: new
participant "Pkg" as Pkg1, Pkg2
User -> Pkg1 ++ : func
B -> Pkg2 ++ #red : func
Pkg1 --> User --
Pkg2 --> B --
B --> A --
deactivate A
@enduml

Regards
Artur D.
commented Dec 5, 2018 by Divakar
Any updates on this feature request?
commented Apr 20, 2021 by Leo
Are there any updates regarding this functionality?
commented Sep 5, 2023 by BSD

I would very much like to see this feature implemented. I have an essential problem shown below.

@startuml

participant "Request Handler" as RH  << (S,#ADD1B2) Server >> order 3
participant Alice #lightGreen
participant Bob #white

Alice -> Bob ++: Valid Authentication Request
Bob -> RH --++: formatted Authenticated Request (VALID)
RH --> Bob --++: Request Authenticated Response (OK)
Alice -> Bob ++ #FF0000: Invalid Authentication Request
Bob --> Alice --: Authentication Response (OK)

Bob --> RH --++: formatted Authenticated Request (INVALID)
RH --> Bob --++: Request Authenticated Response (DENIED)
Alice <-- Bob --: Authentication Response (DENIED)

Alice -> Bob1 ++: Valid Authentication Request
Bob1 -> RH --++: formatted Authenticated Request (VALID)
RH --> Bob1 --++: Request Authenticated Response (OK)
Alice -> Bob2 ++: Invalid Authentication Request
Bob1 --> Alice --: Authentication Response (OK)

Bob2 --> RH --++: formatted Authenticated Request (INVALID)
RH --> Bob2 --++: Request Authenticated Response (DENIED)
Alice <-- Bob2 --: Authentication Response (DENIED)

@enduml

The red sequence is WRONG as it shows an okay response to the invalid request.

As for the appropriate syntax, what we need is a name for the activation. If we had something like this it might work.

<!--StartFragment-->Alice -> Bob ++(B1): Valid Authentication Request

RH --> Bob --(B1)++(B1): Request Authenticated Response (OK)

RH --> Bob --(B1)++<!--StartFragment-->(B1)<!--EndFragment-->: Request Authenticated Response (OK)

Alice -> Bob ++(B2): Invalid Authentication Request
Bob --> Alice --<!--StartFragment-->(B1)<!--EndFragment-->: Authentication Response (OK)<!--EndFragment-->

...