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

default $direction="" arguments of Rel_() call are not working #124

Closed
kirchsth opened this issue Feb 21, 2021 · 0 comments · Fixed by #125
Closed

default $direction="" arguments of Rel_() call are not working #124

kirchsth opened this issue Feb 21, 2021 · 0 comments · Fixed by #125
Milestone

Comments

@kirchsth
Copy link
Contributor

Hi @Potherca, @adrianvlupu,

I checked the Rel_() definitions with the default argument $direction=""

!unquoted procedure Rel_($alias1, $alias2, $label, $direction="")
!unquoted procedure Rel_($alias1, $alias2, $label, $techn, $direction="")

and

  1. they are not working with default values (if $direction is "" an invalid PlantUML syntax is created, you can test it in sample below)
  2. if you use Rel_() with 4 arguments it is not clear if it uses the first or second definition.

I checked all combinations

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

Person(personAlias, "Label", "Optional Description")
Container(containerAlias, "Label", "Technology", "Optional Description")
 
' C4.puml has two active Rel_ definitions (both with $direction default values)
' !unquoted procedure Rel_($alias1, $alias2, $label, $direction="")
' !unquoted procedure Rel_($alias1, $alias2, $label, $techn, $direction="")

' first Rel_ with $direction default value is not working
' creates "personAlias containerAlias: **Label**" and this produce "Syntax Error?"
' Rel_(personAlias, containerAlias, "Label")

' first Rel_ with concrete $direction is working (and used, means second Rel_ with default value of $direction is ignored)
Rel_(personAlias, containerAlias, "Label", "<-->")

' second Rel_ with $direction default value is not working
' creates "personAlias http containerAlias: **Label**" and this produce "Syntax Error?"
' Rel_(personAlias, containerAlias, "Label", "http")

' second Rel_ with concrete $direction is working (and used)
Rel_(personAlias, containerAlias, "Label", "http", "<<-->>")

' correct Rel_ definitions are without default values 
' !unquoted procedure Rel_($alias1, $alias2, $label, $direction)
' !unquoted procedure Rel_($alias1, $alias2, $label, $techn, $direction)
@enduml

$direction has to be defined

at 2. first definition is used.

Therefore I think we should remove all default values (and extend only the second Rel_ in the future, if required).
Is my assumption correct or have I overseen something?

BR Helmut

kirchsth added a commit to kirchsth/C4-PlantUML that referenced this issue Feb 21, 2021
adrianvlupu added a commit that referenced this issue Mar 13, 2021
#124 Remove not working, misleading and unused default values
@Potherca Potherca added this to the v2.1.0 milestone Apr 4, 2021
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

Successfully merging a pull request may close this issue.

2 participants