Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started 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!
-
Could you point me to where exactly that is documented? This is the first time I hear of such a reference.
q.
-
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...
-
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?" ;)
-
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. :-/
-
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.
-
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!
-
You need to use
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.
-
thank you sir! I got it working! :D
-
One last question: where can I find information on the other "Types" I could query?
-
Can you put me on rails regarding the "Types". I won't read the whole thread again :-/
q.
-
your query: "SELECT * FROM t_xref WHERE [highlight]Type [/highlight]= 'reference'
Where can I find a list of the "types"?
-
On pages 34/35 of my Inside book.
q.
-
hmm. Was hoping for a Sparx reference/answer, not a product plug. :-/
thanks!