plantuml-stdlib / C4-PlantUML

C4-PlantUML combines the benefits of PlantUML and the C4 model for providing a simple way of describing and communicate software architectures
MIT License
6.33k stars 1.1k forks source link

Use the alias of a relationship #360

Closed rokdd closed 3 weeks ago

rokdd commented 3 weeks ago

I am using just the default "Rel" without a direction. Now I want to add a note with plantuml like this:

Rel(c2_container16, c2_container17)
note top of c2_container16c2_relationships21c2_container17 #HotPink
What is this rel really doing??
end note

So I would be lucky do define also an alias for relationships? Because you concat in the macro as far as I understand alias1+direction+alias2 - but I don't know the direction? Or do I miss something?

kirchsth commented 3 weeks ago

HI @rokdd,

I think relationships have no alias in PlantUML itself. But if you want you can add a note to the previous relationship like below (top is optional and defines the direction)

Rel_L(a,b,"sends(email)")

note top of link #lightgreen
this is a note
end note

a full sample see below

BR Helmut

PS.: If you only want to add more details to a relationship, why do you not use the description argument $descr="What is this rel really doing??"? Details see Relationship Types

rokdd commented 3 weeks ago

Hello @kirchsth thanks for your fast response.. I use the description already for parameters etc of the request and the notes I want to add are really like a additional work layer what needs to be solved or discussed. They should look different and pop in the eye ;-) link is referring to previous line?

kirchsth commented 3 weeks ago

Yes: link refers the previous Rel() call. I tried following and it works, but I think it is very misleading

Rel_U(a,b,"sends(email)")

Component(c,c,xxx̌x)
note bottom of link #lightgreen
  This note belongs to "sends(email)" call  (I would move it up)
end note

My web link in previous comment was wrong, I fixed it: Relationship Types

kirchsth commented 3 weeks ago

Does it solve your issue?

rokdd commented 3 weeks ago

Thank you, I just changed my code to follow the note directly after the relationship. A bit shaky but it works, would be great to have optional argument for the relationship to add an own alias but for the moment it is fine ;-)