Skip to content

SHOW_PERSON_OUTLINE renders external Person as internal #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chriskn opened this issue Nov 19, 2022 · 8 comments
Closed

SHOW_PERSON_OUTLINE renders external Person as internal #265

chriskn opened this issue Nov 19, 2022 · 8 comments
Assignees
Milestone

Comments

@chriskn
Copy link

chriskn commented Nov 19, 2022

The following diagram:

@startuml
!includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml

Person_Ext(8, "Person A")

SHOW_LEGEND(true)

@enduml

is rendered as expected:
grafik

With the SHOW_PERSON_OUTLINE option:

@startuml
!includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml

SHOW_PERSON_OUTLINE()

Person_Ext(8, "Person A")

SHOW_LEGEND(true)

@enduml

External Person is rendered as internal, while the legend still contains external_person:
grafik

The issue exists for Context, Container and Component diagrams. The issue was likely introduced with release 2.4.0., at least I did not notice it before.

@chriskn chriskn changed the title SHOW_PERSON_OUTLINE renders external Persons as internal SHOW_PERSON_OUTLINE renders external Person as internal Nov 19, 2022
@kirchsth
Copy link
Member

kirchsth commented Nov 19, 2022

@chriskn:

which PlantUML version are you using?
I tried it in with the current PlantUML web server and cannot reproduce the problem.
(I extended it after my first test with the C4Version() and %version() that the C4 and PlantUML are displayed too)

http://www.plantuml.com/plantuml/uml/LOvHIuKm68RlzolMWM32EUx6Y-ZAi561gMJMvPWwSZ0tsRwLFp-7nS6xP--Ub_VBFGW7OTReHfb1Xr46f_44iFXxIftuIRyKJA4FNhh16f06qi7ETD72nDh5mwXLJuliqiIeUotfB3n8jqMyY8qLqYKEeFQv_kGDUslhYjVTU_bICP8Wr4ZdhU5i1N9tngVzYHzEnw_l3PKrPtpxHoGv2aNsyQz4l3hxRicUMFL8m0MPe5oQSJlf5m00

@startuml
!includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml

SHOW_PERSON_OUTLINE()

Person_Ext(8, "Person A")
Person_Ext(version, %version())
Person_Ext(C4Version, C4Version())

SHOW_LEGEND(true)
@enduml

BR Helmut

@chriskn
Copy link
Author

chriskn commented Nov 20, 2022

Hi @kirchsth

@startuml
!includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml

SHOW_PERSON_OUTLINE()

Person_Ext(version, %version())
Person_Ext(C4Version, C4Version())

SHOW_LEGEND()

@enduml

grafik

I am using the PlantUML integration for IntelliJ in version 5.19 and asciidoctorj diagram in version 2.2.1.

@kirchsth
Copy link
Member

Can you try it with the PlantUML deployed C4-stdlib?

@startuml
!includeurl <C4/C4_Container.puml>

SHOW_PERSON_OUTLINE()

Person_Ext(version, %version())
Person_Ext(C4Version, C4Version())

SHOW_LEGEND()
@enduml

@chriskn
Copy link
Author

chriskn commented Nov 20, 2022

That one works as expected:
grafik

I wasn't aware of this include url schema. Are these includes something like the stable or recommended versions?

@kirchsth
Copy link
Member

kirchsth commented Nov 20, 2022

!includeurl <C4/C4_Container.puml>; I wasn't aware of this include url schema. ...

As soon we have a new release we export it to the PlantUML-stdlibs too that it can be used without any additional includes ...

related to the different outputs
I found problems with other diagrams too, e.g. in following sample the color of the person label should be yellow(==background) and not green (the Person_Ext has the correct gold color)

@startuml
!include <C4/C4_Context.puml>

UpdateElementStyle("person","yellow","green","blue")
UpdateElementStyle("external_person","gold", "red", "darkred")

' SHOW_PERSON_OUTLINE()
SHOW_PERSON_PORTRAIT()
Person(version3, "uiuzdsiss")
Person_Ext(versi4, "uiuzdidfsaf")

SHOW_LEGEND(false)
@enduml

correct via PLantUML web server

wrong with IntellijPlugin

diag-dae5b608de1db526e54717a9e8752618

I compared the extracted metadata of both images and

  • both uses the exact same plantuml preprocessore source

  • the only found difference was the source distribution:

    • (working) PlantUML Web Server
PlantUML version 1.2022.13beta8(Unknown compile time)
(GPL source distribution)
Java Runtime: Java(TM) SE Runtime Environment
JVM: Java HotSpot(TM) 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: US
  • (not working) PlantUML integration for IntelliJ in version 5.19
PlantUML version 1.2022.5(Sat Apr 30 12:55:52 CEST 2022)
(APACHE source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Default Encoding: Cp1252
Language: en
Country: US

@kirchsth
Copy link
Member

I found the problem: "PlantUML integration for IntelliJ" uses an too old plantuml.jar version. If they update to the last plantuml.jar version it should work again.

Details:

If an older plantuml version is used (I checked it with plantuml.1.2022.2)

skinparam person<<person>> {
    FontColor green
}

overwrites the actor specific skinparam too

skinparam actor<<person>> {
    FontColor yellow
}

which should not be the case (and it is fixed in the meantime)

it can be tested with following

@startuml

skinparam actor {
    StereotypeFontSize 12
    shadowing false
    style awesome
}

skinparam actor<<person>> {
    StereotypeFontColor yellow
    FontColor yellow
    BackgroundColor yellow
}
skinparam person<<person>> {
    StereotypeFontColor green
    FontColor green
    BackgroundColor yellow
}

skinparam actor<<external_person>> {
    StereotypeFontColor gold
    FontColor gold
    BackgroundColor gold
}
skinparam person<<external_person>> {
    StereotypeFontColor red
    FontColor red
    BackgroundColor gold
}

actor "==uiuzwreerqwrrrqrrqdi" <<person>> as version3
actor "==uiuzdi" <<external_person>> as versi4

@enduml

If an old version is used the yellow actor<<person>> font is overwritten with the wrong green person<<person>> font.
In the newer versions the bug is fixed and the actor font remains yellow. (<<external_person>> is not affected by the bug)

@kirchsth kirchsth self-assigned this Nov 20, 2022
@kirchsth kirchsth added this to the v2.5.0 milestone Nov 20, 2022
@kirchsth
Copy link
Member

@chriskn can you please test my added workaround #266?

@Potherca
Copy link
Member

It might be worth noting that the IntelliJ plugin for PlantUML has an option to use a local plantuml.jar (instead of the bundled one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants