Skip to content
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

#287 System and person support [...] notation #294

Merged

Conversation

kirchsth
Copy link
Contributor

@kirchsth kirchsth commented Mar 10, 2023

close #287

C4 Model extension: Person() and System() support $type argument too.
Is uses the same notation as $techn, e.g. $type="characteristic A" is displayed as [characteristic A]

Following macros are extended with the optional argument $type:

  • AddPersonTag(), AddExternalPersonTag(), AddSystemTag(), AddExternalSystemTag() is extended with $type as last argument.
  • Person(), System(),... is extended with $type as last argument.
  • cleanup of AddNodeTag() that it can use $type like in the Node() call itself.
@startuml
' convert it with additional command line argument -DRELATIVE_INCLUDE="./.." to use locally
!if %variable_exists("RELATIVE_INCLUDE")
  !include %get_variable_value("RELATIVE_INCLUDE")/C4_Container.puml
!else
  !include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Container.puml
!endif

' e.g. during first discussions no sprites are available but the categories should be displayed in the UI
AddExternalPersonTag("anonymous_ext", $type="anonymous user")
AddPersonTag("customer", $type="aggregated user")
AddPersonTag("admin", $legendText="administration user", $type="administrator")
AddExternalSystemTag("git_repository", $type="web-based Git repository")

Person_Ext(anonymous_user_v1, "Bob", "simplified version during first discussions ($type defines the role), after discussion the $type can be replaced with concrete $sprite", $type="anonymous user")
Person(aggregated_user_v1, "Sam, Ivone", $tags="customer", $type="replaced with customer")
Person(administration_user_v1, "Bernd", $tags="admin")

System(system1, "System 1", $type="new developed system")

System_Ext(github, "GitHub", $tags="git_repository", $type="graphical web-based Git repository")
System_Ext(gitlab, "GitLab", $tags="git_repository")

!define osaPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons/master
!include osaPuml/Common.puml
!include osaPuml/User/all.puml

Person_Ext(anonymous_user_v2, "Bob 2", "Update with sprites", $sprite="osa_user_black_hat")
Person(aggregated_user_v2, "Sam, Ivone 2", $tags="customer", $sprite="osa_user_large_group")
Person(administration_user_v2, "Bernd 2", $tags="admin", $sprite="osa_user_audit,color=red")

HIDE_STEREOTYPE()
@enduml

It can be tested with my extended branch

@mtnpke, @Potherca: $type enables the simplest merge, therefore I didn't change it, but if you want I still can change it in this PR

BR
Helmut

@kirchsth kirchsth requested a review from Potherca March 10, 2023 22:52
@kirchsth kirchsth added this to the v2.6.0 milestone Mar 10, 2023
@kirchsth kirchsth merged commit 859853b into plantuml-stdlib:master Mar 25, 2023
@kirchsth kirchsth deleted the feature/PersonSystemWithType branch April 10, 2023 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend System() and Person() with [.....] notation
2 participants