Book a Demo

Author Topic: Access Target Scope from a ConnectorEnd  (Read 7617 times)

RAlexander

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Access Target Scope from a ConnectorEnd
« on: March 18, 2014, 07:47:12 am »
I'm doing a bit of custom code generation and I am trying to figure out how to get the value of the Target Scope (entered on the Target Role item of the Association Properties dialog) within a VBScript. I cannot seem to locate the name of the object property for this. Does one exist?

Thanks!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Access Target Scope from a ConnectorEnd
« Reply #1 on: March 18, 2014, 08:57:49 am »
Try Connector.ClientEnd and SupplierEnd. They hold ConnectorEnd objects each.

q.
« Last Edit: March 18, 2014, 08:58:05 am by qwerty »

RAlexander

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Access Target Scope from a ConnectorEnd
« Reply #2 on: March 18, 2014, 09:21:39 am »
Yes, but the target/source scope attributes do not seem to be in Connector.ClientEnd/SupplierEnd. They are, however,in the properties available to  shape scripts (pp 73/74 of the documentation for the EA Software Developer's Kit) and also for as template substitution macros (p. 98) . But as far as I can tell, they are not in the properties for the EAConnectorEnd objects made available to VBScript  (at least under the names used in SDK documentation).

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Access Target Scope from a ConnectorEnd
« Reply #3 on: March 18, 2014, 09:38:28 am »
Try ConnectorEnd.Visibility
The Sparx Team
[email protected]

RAlexander

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Access Target Scope from a ConnectorEnd
« Reply #4 on: March 18, 2014, 09:55:55 am »
ConnectorEnd.Visibility gives the access level (i.e., public, protected, private, or package), but not the target scope (which is either instance or classifier).

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Access Target Scope from a ConnectorEnd
« Reply #5 on: March 18, 2014, 12:06:07 pm »
Try
Code: [Select]
Repository.SQLQuery("SELECT SourceTS, DestTS FROM t_connector WHERE Connector_ID = <id>"
That will return the values you are looking for. I guess the API does not provide them otherwise?!

q.
« Last Edit: March 18, 2014, 12:06:37 pm by qwerty »

RAlexander

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Access Target Scope from a ConnectorEnd
« Reply #6 on: March 19, 2014, 04:04:07 am »
Thanks! I'll give that a try.

RAlexander

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Access Target Scope from a ConnectorEnd
« Reply #7 on: March 19, 2014, 04:19:54 am »
Thank works! Thanks very much.

Any suggestion as to parse the XML result in VBScript??

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Access Target Scope from a ConnectorEnd
« Reply #8 on: March 19, 2014, 05:29:54 am »
There was a recent post about parsing XML in VBScript posted by Nazim. Use the Search button top left and extend the time to one year.

q.