Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: A. Engle on June 28, 2014, 06:44:48 am

Title: List Context References
Post by: A. Engle on June 28, 2014, 06:44:48 am
This is different than the "Copy Context References" discussion...

I am trying to use C# to grab the context references made in a use case.  Context References are not necessarily made via CONNECTORS.  (See the Sparx documentation for Custom References and how to make context references).

Because a context reference can be made without a connector, I need some direction on how to grab the context references for an element (not connectors).

Which class will I find the proper methods or properties for this?  I've looked, researched, etc and this is my final stop.  :-/

Thanks in advance!
Title: Re: List Context References
Post by: qwerty on June 28, 2014, 06:49:19 am
Could you point me to where exactly that is documented? This is the first time I hear of such a reference.

q.
Title: Re: List Context References
Post by: A. Engle on June 28, 2014, 07:02:03 am
Sure.  You can find it in the Sparx help documentation by searching for context references.

But I've pulled that for you here:  http://www.sparxsystems.com/enterprise_architect_user_guide/10/modeling_basics/set_up_scenario_specification.html

at the bottom of the page you'll find a link for the Context References tab.

here's how to create a custom reference (context reference) between elements:  http://www.sparxsystems.com/enterprise_architect_user_guide/9.0/modeling_basics/crossreferences.html


qwerty, I find it hard to believe you've written books on Sparx and don't know what a context reference is dude...just saying.   :o  but I appreciate your help nonetheless...
Title: Re: List Context References
Post by: qwerty on June 28, 2014, 05:26:45 pm
Well, there is a recent discussion about those. Actually these ARE based on connectors. You can prove that: create a UC and an Actor. Now create an association between both. The actor is shown in the list. Remove the connector. The actor vanishes. So this is simply a different rendering for a connector.

q.

P.S. http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1402492976
So indeed this is the 2nd time I hear from that. I DID know these, but it simply was placed in the outer rim of my brain. Probably because I knew from the beginning that they were just connector based renderings. Still the term is located in the outer rim. Perhaps the next time I'll as again: "what is that?"  ;)
Title: Re: List Context References
Post by: A. Engle on June 30, 2014, 10:21:44 pm
That is correct.  Your association connection is what is showing in the list, not a reference connection.  Create a context reference per the documentation posted above without drawing a connector, the reference will show under "references" for the element, but there is no connector...connection.

I've tested this a variety of ways, most notably, listing out the connecters for an element and the reference elements are not listed, even on the referenced item.

Hence...why I'm posting my question.   :-/
Title: Re: List Context References
Post by: qwerty on June 30, 2014, 11:45:06 pm
Found it. It's in t_xref where Type = 'reference'

But now the question: why do you use this strange construct? Can't you live with simple connectors? There are certainly more "UML-standard" ways to achieve these links.

q.
Title: Re: List Context References
Post by: A. Engle on June 30, 2014, 11:55:41 pm
What is that in C#?  I cannot locate it in the object library.

We're working on a proof of concept.  This methodology may not stick, just testing out different scenarios, etc. etc.

THANKS!
Title: Re: List Context References
Post by: qwerty on July 01, 2014, 12:24:33 am
You need to use
Code: [Select]
Repository.SQLQuery ("SELECT * FROM t_xref WHERE Type = 'reference' AND Client = '<ea_guid_c>' AND Supplier = '<ea_guid_s>'")Where the two guids are those of the connected element guids.

q.
Title: Re: List Context References
Post by: A. Engle on July 02, 2014, 04:25:30 am
thank you sir!  I got it working! :D
Title: Re: List Context References
Post by: A. Engle on July 12, 2014, 04:55:54 am
One last question:  where can I find information on the other "Types" I could query?
Title: Re: List Context References
Post by: qwerty on July 12, 2014, 08:19:40 am
Can you put me on rails regarding the "Types". I won't read the whole thread again :-/

q.
Title: Re: List Context References
Post by: A. Engle on July 14, 2014, 11:13:09 pm
your query:  "SELECT * FROM t_xref WHERE [highlight]Type [/highlight]= 'reference'

Where can I find a list of the "types"?
Title: Re: List Context References
Post by: qwerty on July 15, 2014, 03:30:28 am
On pages 34/35 of my Inside book.

q.
Title: Re: List Context References
Post by: A. Engle on July 15, 2014, 04:48:36 am
hmm.  Was hoping for a Sparx reference/answer, not a product plug.   :-/

thanks!