Broadcast or a Multicast message in a sequence diagram

0 votes
asked Oct 14, 2014 in Wanted features by christoph.buehne (120 points)
retagged Jan 30, 2015 by plantuml
I have the following code:

A->B: Hello

A->C:Hello

The problem is that the line is in two lines. I would like to have one line with many arrows on each or some participants.

Could there be a possibility to add :

A->B and C: Hello  // Multicast message

and

A->*:Hello    //Broadcast message

1 Answer

0 votes
answered Feb 2, 2015 by plantuml (257,860 points)
Hello,

It took some time, but we have started to work on the subject. (see http://plantuml.com/teoz.html )

Our proposal allows to have several arrows on the same line, even if the syntax is not the one you hae proposed.

Your feedback will be appreciate!
commented Feb 10, 2016 by anonymous
Hello,

I saw your suggestion with the "& Bob -> Charlie" syntax.
I share your concern because I don't think it is very intuitive.
I thought a bit and two syntaxes came to me:

Syntax 1:

@startuml
Alice -> (Bob,  Charlie) : hello
@enduml

Syntax 2:

@startuml
cluster Buddies
   Bob, Charlie
end
Alice -> Buddies : hello
@enduml

I think that the two syntaxes could be mixed.
commented Feb 3 by PascalChap (320 points)

I saw your suggested syntax. I think it does not help to read and maintain the source file.

I saw also that it allows to have different messages to each receiver, but it is not a use case I can imagine. In my opinion, the intent is to represent clearly a multicast or broadcast message, so the same message sent to multiple receiver at the same time. The message must be shown only once, before the closest (geographically) receiver

the first syntax I would like is sending from one emitter to a list of receiver:

Alice -> Bob & Charlie : my multicast message

or

Alice -> [Bob,Charlie] : my multicast message

or the same using any braket that does not create conflict in the current grammar

Then a syntax for broadcast is a nice to have, I like the proposal from christoph.buehne:

Alice -> * : My broadcast message

I don't think it is usefull to have a special syntax to create a list of receiver since we can use Macro for this.

I join a small example of what I would like to get:

http://www.plantuml.com/plantuml/png/TOtDgi8m44RtUOhlRcv1waANBgHRdq5SJ9AX59Ccv0V5fpSM2Wsaos_EuSmG4uMKhG6_oNh3GlpvGACb97OVf93BoHTdKfEdEO6g9QkbggMhLJBT3I-NZOQPdYmwYUCLTzNp0nVOR8fACS5oZ3GoJaB25KFjq7_y0eskMhhKwtRtBDJIfJP52Iy5lSFR_mx5bi6HtjhhfpKfMzBctpva8GQUTRRc2m00

Best regards

commented Feb 8 by plantuml (257,860 points)
Ok, so here a new proposal :-)

With last beta http://beta.plantuml.net/plantuml.jar you can now have :

http://www.plantuml.com/plantuml/uml/ROox3i8m34NtVCLbwSO08mCgZnynmIgHR88S6mc-7b4rMxUZetFls9pCGoLjNaQJ4fph5sx1YR9NmqbAxdokjuKk3p8ftL_fpMaEiJt-AmopEq0_q10lcPf3kJMQUBUMOkYVM5_jqyZFUwZy0000

This is really an early release: it probably does not work in all cases. We are interested in feedback.

Does it sound better to you ?
commented Feb 11 by anonymous

Hello, the proposal is pretty simple and has for me the 2 interesting properties:

  • it is obvious when reading it that the message is sent to all participant at the same time (IMHO)
  • it is easy to move in the code with low risk of error (one line)

I don't have any preference between a & b & c, [a,b,c] ... and I don't know exactly what are your grammar constraints.

So far it works if the sender is on the left and all receiver on the right. It doesn't work for any other cases. (important to describe multi-device systems). But you said that it is an early release.

yes

commented Feb 12 by plantuml (257,860 points)

I don't have any preference between a & b & c, [a,b,c] ... and I don't know exactly what are your grammar constraints.

There are no real gramme constraints. We find the '&' syntax easier to read. Let's keep it that way right now and see what other people say.

So far it works if the sender is on the left and all receiver on the right. It doesn't work for any other cases. (important to describe multi-device systems). But you said that it is an early release.

Thanks for the report: we are very lazy on our tests and we count on you for that :-) So please go on when you will find other issues.

So this is fixed with last beta http://beta.plantuml.net/plantuml.jar and on the online server.

Note that we have slightly changed the drawing: a small step has been added for multicast messages. It's just a proposal: we find it slightly more readable. We can remove it if you don't like that.

...