Hi
I am using parameters to drive conditional drawing of participants in box groups in a sequence diagram - I am running on planttext.com
Sequence Blocks setup as
'===PART 1===
!ifdef PART1
Sequence goes herr
!endif
I was helped in an earlier question with preprocessor functions - DRAW works without fault
!unquoted function DRAW($x) return %set_variable_value($x, 1)
'====DRAW Specific Diagrams by Comment/Uncommenting Line===
'====Only uncomment one line at a Time======================
'DRAW(PART1)
DRAW(PART2)
'DRAW(PART3)
'DRAW(PART4)
'DRAW(PART5)
'DRAW(PARTX)
'DRAW(PARTY)
'DRAW(PART_REF)
'DRAW(PART_TMX)
My new function adds a control participant if the defined variable exists
!unquoted function addService($part, $service, $as)
!ifdef $part
'!if %variable_exists($part)
control "$service" as $as
!endif
!endfunction
Used as follows
box "AWS " #LightBlue
participant "mPlatform" as mp
addService("PART_REF", "RefDat_MS", "rdms")
participant "PING Access" as pa
end box
box "ApplicationZone Z5 " #LightGrey
participant "Data Power" as dp_z5
participant "Ping Federate" as pf_z5
participant "ESP" as esp
addService("PART2", "Service Portal", "portal")
!ifdef PART10
participant "Service Portal" as portal
participant "API Gateway" as apig
participant "Service" as service
!endif
end box
In my function
!ifdef $part does not discriminate between defined parameters and inserts all services
!if %variable_exists($part)does not insert any services into the box
Is this a bug or am I missing something ?
Ambition is to have dynamic participants in functional box groups depending on the viewpoint