Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: djdejong on December 13, 2016, 06:32:54 am

Title: Get a gateway's "Type"?
Post 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
Title: Re: Get a gateway's "Type"?
Post by: qwerty on December 13, 2016, 06:57:10 am
What / from what MDG is a Gateway?

q.
Title: Re: Get a gateway's "Type"?
Post by: djdejong on December 13, 2016, 07:02:00 am
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.
Title: Re: Get a gateway's "Type"?
Post by: djdejong on December 13, 2016, 07:05:07 am
I've tried simply "myElement2.Type", but that only gives "Decision".
Title: Re: Get a gateway's "Type"?
Post by: philchudley on December 13, 2016, 07:10:25 am
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
Title: Re: Get a gateway's "Type"?
Post by: djdejong on December 13, 2016, 08:52:09 am
OK figured it out by looking in the tagged values, thanks! This is how I tested it:

Code: [Select]
'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
Title: Re: Get a gateway's "Type"?
Post by: djdejong on December 13, 2016, 09:09:25 am
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.
Title: Re: Get a gateway's "Type"?
Post by: qwerty on December 13, 2016, 09:35:48 am
The tagged value you need to inspect is gatewayType. So iterate through Element.TaggedValues an find gatewayType. Then look into TV.value.

q.