Book a Demo

Author Topic: Get a gateway's "Type"?  (Read 5995 times)

djdejong

  • EA User
  • **
  • Posts: 32
  • Karma: +2/-0
    • View Profile
Get a gateway's "Type"?
« 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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Get a gateway's "Type"?
« Reply #1 on: December 13, 2016, 06:57:10 am »
What / from what MDG is a Gateway?

q.

djdejong

  • EA User
  • **
  • Posts: 32
  • Karma: +2/-0
    • View Profile
Re: Get a gateway's "Type"?
« Reply #2 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.

djdejong

  • EA User
  • **
  • Posts: 32
  • Karma: +2/-0
    • View Profile
Re: Get a gateway's "Type"?
« Reply #3 on: December 13, 2016, 07:05:07 am »
I've tried simply "myElement2.Type", but that only gives "Decision".

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Get a gateway's "Type"?
« Reply #4 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
Models are great!
Correct models are even greater!

djdejong

  • EA User
  • **
  • Posts: 32
  • Karma: +2/-0
    • View Profile
Re: Get a gateway's "Type"?
« Reply #5 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

djdejong

  • EA User
  • **
  • Posts: 32
  • Karma: +2/-0
    • View Profile
Re: Get a gateway's "Type"?
« Reply #6 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.
« Last Edit: December 13, 2016, 09:20:57 am by djdejong »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Get a gateway's "Type"?
« Reply #7 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.