Skip to content

Commit

Permalink
#320 Dynamic/Sequence fix Rel() without $index argument
Browse files Browse the repository at this point in the history
  • Loading branch information
kirchsth committed Sep 4, 2023
1 parent 7424ad9 commit 3a379dd
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
41 changes: 39 additions & 2 deletions C4_Dynamic.puml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ $getRel($direction, $alias1, $alias2, $e_index + ": " + $label, $techn, "", "",

' all RelIndex... calls are outdated, Rel(..., $index=...) calls should be used !!!!

' first Rel() supports the $index argument too; second Rel() overwrites C4.puml definition
!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="")
!$pre = $getPrefix($index)
$getRel("-->>", $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "")
!endprocedure
!unquoted procedure RelIndex($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getRel("-->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
Expand All @@ -47,6 +51,9 @@ $getRel("-->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $
!$pre = $getPrefix($index)
$getRel("<<--", $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
!unquoted procedure Rel_Back($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_Back($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "")
!endprocedure
!unquoted procedure RelIndex_Back($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getRel("<<--", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
Expand All @@ -55,6 +62,9 @@ $getRel("<<--", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $
!$pre = $getPrefix($index)
$getRel("->>", $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
!unquoted procedure Rel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_Neighbor($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "")
!endprocedure
!unquoted procedure RelIndex_Neighbor($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getRel("->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
Expand All @@ -63,6 +73,9 @@ $getRel("->>", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $t
!$pre = $getPrefix($index)
$getRel("<<-", $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
!unquoted procedure Rel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_Back_Neighbor($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "")
!endprocedure
!unquoted procedure RelIndex_Back_Neighbor($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getRel("<<-", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
Expand All @@ -71,10 +84,16 @@ $getRel("<<-", $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $t
!$pre = $getPrefix($index)
$getRel($down("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
!unquoted procedure Rel_D($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_D($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "")
!endprocedure
!unquoted procedure Rel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="")
!$pre = $getPrefix($index)
$getRel($down("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
!unquoted procedure Rel_Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_Down($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "")
!endprocedure
!unquoted procedure RelIndex_D($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getRel($down("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
Expand All @@ -86,10 +105,16 @@ $getRel($down("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr,
!$pre = $getPrefix($index)
$getRel($up("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
!unquoted procedure Rel_U($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_U($from, $to, $label, $techn, $descr, $sprite, $tags, $link=, "")
!endprocedure
!unquoted procedure Rel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="")
!$pre = $getPrefix($index)
$getRel($up("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
!unquoted procedure Rel_Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_Up($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "")
!endprocedure
!unquoted procedure RelIndex_U($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getRel($up("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
Expand All @@ -101,9 +126,15 @@ $getRel($up("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $s
!$pre = $getPrefix($index)
$getRel($left("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
!unquoted procedure Rel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
!unquoted procedure Rel_L($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_L($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "")
!endprocedure
!unquoted procedure Rel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="")
!$pre = $getPrefix($index)
$getRel($left("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link, $index="")
$getRel($left("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
!unquoted procedure Rel_Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_Left($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "")
!endprocedure
!unquoted procedure RelIndex_L($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getRel($left("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link)
Expand All @@ -116,10 +147,16 @@ $getRel($left("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr,
!$pre = $getPrefix($index)
$getRel($right("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
!unquoted procedure Rel_R($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_R($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "")
!endprocedure
!unquoted procedure Rel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="")
!$pre = $getPrefix($index)
$getRel($right("-","->>"), $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
!unquoted procedure Rel_Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_Right($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "")
!endprocedure
!unquoted procedure RelIndex_R($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
$getRel($right("-","->>"), $from, $to, $e_index + ": " + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
Expand Down
4 changes: 4 additions & 0 deletions C4_Sequence.puml
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ end box

' only Rel is supported in sequence diagram

' first Rel() supports the $index and $rel argument too; second Rel() overwrites C4.puml definition
' don't add empty lines in procedure otherwise & calls are not working anymore '& a -> b: call' are not working anymore
!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="", $index="", $rel="")
!if ($show_index == %true())
Expand All @@ -392,3 +393,6 @@ end box
!endif
$getRel($rel, $from, $to, $pre + $label, $techn, $descr, $sprite, $tags, $link)
!endprocedure
!unquoted procedure Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel($from, $to, $label, $techn, $descr, $sprite, $tags, $link, "", "")
!endprocedure

0 comments on commit 3a379dd

Please sign in to comment.