Senderless create message goes to object lifeline rather than create an object

+1 vote
asked Nov 30 in Bug by Fuhrmanator (1,300 points)

Hello! Sorry if this is a duplicate (I couldn't find it, but I know I stumbled on this before and perhaps didn't report the bug). 

I want to start a sequence diagram with an object being created, but the create message is sent to the lifeline rather than showing a new object. The simplest example:

@startuml
create a
-> a : create
@enduml

Or a more complex one:

@startuml
participant a
participant b
participant c
create b
a -> b : create
create c
-> c : create
@enduml

2 Answers

0 votes
answered Dec 1 by albert (2,580 points)

Did you have a look at the section "Incoming and outgoing messages" in the sequence diagram documentation (http://plantuml.com/sequence-diagram).

This gives (http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuKekIaqiILL8v8hMjLD8LB1IW0XmEQJcfG3b0G00):

@startuml
create a
[-> a : create
@enduml

and (http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuIe0qfd9cGM9UIKAYIYy91HUCbToKMfYIIfGE551rquXIS5A0I82bG2gY0QA9oF47LBpKe1M0000)

@startuml
participant a
participant b
participant c
create b
a -> b : create
create c
[-> c : create
@enduml
0 votes
answered Dec 1 by plantuml (208,860 points)
Yes, this is indeed a bug.

It's a case we did not think of :-)

Not sure it's easy to fix : we are going to investigate !
commented Dec 1 by Andrespo (120 points)
Maybe an "invisible" participant should be introduced? It could be named or not like this 'sendrerless'.
commented Dec 1 by albert (2,580 points)

I'm a bit amazed as the documentation (section "Incoming and outgoing messages" in the sequence diagram documentation http://plantuml.com/sequence-diagram) gives the example with the '[' and ']', is there a reason saying this is a bug and if so what is the difference between situation with and without the '[' / ']'?

It would indeed be easier and better to read without the '[' / ']'.

...