Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: djdejong on December 13, 2016, 06:32:54 am
-
Hi,
This should be an easy thing, I'm just unsure of where to get the info. I want to get the name of the "Type" of an element in my VBScipt, in particular one with the stereotype "Gateway". E.g., "Parallel", "Even-Parallel", "Exclusive", etc...
I've looked through the intellisense options and have tried everything that sounded like it could be it, and have had no luck.
Thanks for the help,
Dana
-
What / from what MDG is a Gateway?
q.
-
It's a Business Process Diagram in BPMN 2.0 if that's what you're asking. I have gateway elements located inside that diagram. Is it even relevant that it's a gateway though? The "Type" field I have in mind is a drop-down list available in the properties of every element.
-
I've tried simply "myElement2.Type", but that only gives "Decision".
-
I would try looking through the Tagged Values, since that is where the type of gateway is et when using BPMN 2.0
You can enumerate
myElement.TaggedValues
Phil
-
OK figured it out by looking in the tagged values, thanks! This is how I tested it:
'stereotype already determiend as "gateway"
'find out what type of gateway it is
dim tagVar as EA.TaggedValue
for each tagVar in myElement.TaggedValues
if tagVar.Name = "gatewayType" then
msgbox "Gateway: "&myElement.Name &vbnewline &"Type: "&tagVar.Value
end if
next
-
Also: it looks like you have to further specify eventGatewayType for "Event-Parallel" and "Event-Exclusive" gatewayType, since the tagVar.Value will as shown in my last reply will give "Event" for both of those.
-
The tagged value you need to inspect is gatewayType. So iterate through Element.TaggedValues an find gatewayType. Then look into TV.value.
q.