Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: RAlexander on March 18, 2014, 07:47:12 am

Title: Access Target Scope from a ConnectorEnd
Post by: RAlexander 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!
Title: Re: Access Target Scope from a ConnectorEnd
Post by: qwerty on March 18, 2014, 08:57:49 am
Try Connector.ClientEnd and SupplierEnd. They hold ConnectorEnd objects each.

q.
Title: Re: Access Target Scope from a ConnectorEnd
Post by: RAlexander 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).
Title: Re: Access Target Scope from a ConnectorEnd
Post by: KP on March 18, 2014, 09:38:28 am
Try ConnectorEnd.Visibility
Title: Re: Access Target Scope from a ConnectorEnd
Post by: RAlexander 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).
Title: Re: Access Target Scope from a ConnectorEnd
Post by: qwerty 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.
Title: Re: Access Target Scope from a ConnectorEnd
Post by: RAlexander on March 19, 2014, 04:04:07 am
Thanks! I'll give that a try.
Title: Re: Access Target Scope from a ConnectorEnd
Post by: RAlexander on March 19, 2014, 04:19:54 am
Thank works! Thanks very much.

Any suggestion as to parse the XML result in VBScript??
Title: Re: Access Target Scope from a ConnectorEnd
Post by: qwerty 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.