Export to C4-PlantUML: External persons rendered as internal persons #17
Comments
in plantuml-stdlib/C4-PlantUML#228 I found following problems
Maybe additional changes could be done (or in another PR?):
It could be that https://github.com/cloudflightio/structurizr-export-c4plantuml solves most of the problems already and only the PR has to be completed. @klu2: can you please check my assumption? e.g. with all changes based on following DSL
with the new rules the generator would create something like @startuml
title System Landscape for Customer
top to bottom direction
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4.puml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml
' additional changes: 4. activate person outline
SHOW_PERSON_OUTLINE()
' additional changes: 1. update existing tags/styles if required
UpdateElementStyle("person", #2222CC, $ELEMENT_FONT_COLOR)
' additional changes: if SHOW_PERSON_OUTLINE() is not used, structurizr sprite could be used too
UpdateElementStyle("external_person", #FFCCCC, $ELEMENT_FONT_COLOR, $sprite="person2")
' additional changes: 1. create new tags/styles if required
AddElementTag("Internal user", "#4444FF", $ELEMENT_FONT_COLOR)
AddElementTag("External user", "#FF4444", $ELEMENT_FONT_COLOR, $sprite="person2")
Enterprise_Boundary(enterprise, "Customer") {
' additional changes: 2. invert tag order that most detailed tag wins
' additional changes: (as workaround) 4a. add \n
Person(DWHUser, "DWH User", "Userof some DWH\n", $tags="Internal user+Person+Element")
Person(DWHDeveloper, "DWH Developer", "Developer of some DWH\n", $tags="Person+Element")
}
' additional changes: 2. invert tag order that most detailed tag wins
' additional changes: 3. use External_Person instead of Person
Person_Ext(DHWDeveloper, "DHW Developer", "Developer of DataHandwerk Toolkit", $tags="External_Person+Element")
Person_Ext(DHWUser, "DHW User", "User of DataHandwerk Toolkit", $tags="External user+External_Person+Element")
SHOW_LEGEND()
@enduml @simonbrowndotje: can you accept klu2 PR if everything is working? Thank you and best regards |
I've been fiddling around with this, and the simplest fixes seem to be to just prefix the @kirchsth Customisation using @simonbrowndotje I'm curious: Could you clarify what your purpose is with putting Structurizr tags in the PlantUML files? |
Hi @dirkgroot yes, it works without UpdateElementStyle() too (maybe an export option could be useful) (but if you want the same structurizr colors, ... then you can use it; BR Helmut |
It was a response to this issue -> structurizr/java-extensions#51 |
When I export diagrams from my Structurizr DSL model to C4-PlantUML, external persons are rendered as internal persons. For example:
I expect the external person to be rendered in a gray color, rather than a blue color.
Reproduction scenario
Given this workspace:
When I export the system context diagram to C4-PlantUML, this PUML file is generated:
Resulting in the above image.
Cause
This is caused by the
Person
tag that's being assigned to thePerson_Ext
element in the PUML file. When this tag is replaced byPerson_Ext
or when it's omitted entirely then the external person is rendered correctly.Before creating this issue, I double-checked whether or not this is intended behaviour for C4-PlantUML: plantuml-stdlib/C4-PlantUML#228.
Possible solutions
Person_Ext
tag instead of thePerson
tag.The text was updated successfully, but these errors were encountered: