Hi I'm trying to understand why the following gets an syntax error "
@startuml
!unquoted function DRAW($x) return %set_variable_value($x, 1)
!procedure addComponent($part, $component, $as)
!if %variable_exists($part)
participant "$component" as $as
!endif
!endfunction
!procedure addBox2($part, $box, $colour, $data)
!if %variable_exists($part)
box "$box" #$colour
!foreach $item in $data.participants
$addComponent($part, "$item.name" as $item.as)
!endfor
end box
!endif
!endfunction
DRAW(PART25)
!ifdef PART25
title TESTING (Boxes & Participants) Part25
!endif
!$data={"participants" :[
{"name": "XYZ" ,"as": "xyz"},
{"name": "RST" ,"as": "rst"},
{"name": "UVW" ,"as": "uvw"}
]
}
$addBox2("PART25", "New Box", "white" ,"$data")
zyz->rst : Message()
xyz<--rst : Ack()
xyz->rst : Message2()
xyz->uvw : Message3()
@enduml
And the following doesn't
@startuml
title TESTING (Boxes & Participants) Part25
box "New Box" #White
participant XYX as xyz
participant RST as rst
participant UVW as uvw
end box
xyz->rst : Message()
xyz<--rst : Ack()
xyz->rst : Message2()
xyz->uvw : Message3()
@enduml