Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: salaniojr on May 30, 2013, 12:54:29 am
-
So, I want to, programatically, link to an existing element (Requirement) in the Results field in ScenarioStep.
When I set in code:
EA.ScenarioStep step = GetStep();
step.Results = "R01 - Some Requirment"
step.Update()
...
I just have a string, not the link, because I don't have the existing element in the Context References list in the Scenario.
How to I put this element in the Context References?
I've already tried via EA.Repository.Execute(), update the EA.Scenario.XMLContent, but no sucess.
Is this, anyway, possible?
-
What is a Context Reference? And what does your GetStep() do?
q.
-
Hi qwerty,
GetStep() just return a new EA.ScenarioStep element.
Context References can be seen in this image (marked in yellow). The Table shows you the elements that I can link to in Action, Uses, Result and State in the Step table above it.
(https://dl.dropboxusercontent.com/u/26507486/ContextReferences.PNG)
-
The context reference is just the listing of elements connected to the use case via arbitrary connectors. It is in no way related to any scenario step, except that these are inside the use case.
q.
-
So,
Why the linking (like url links) is done only if I have the element in Context Reference table?
If I put the name of a Requirement element in the Uses or Results field in the step table that is not in Context Reference, it's just a string, but if the element is there, the string turns into a link to the referenced element, you can click and it opens the element.
What I want is to add elements to that context reference table programatically. This is not a Connector, not that I know. Maybe a special kind of Connector that I'm not aware of. Because the Connector I know is in UC's Links section.
There's a way to access this? Are those especial kind of Connectors?
-
You are not right here. Just try this:
- create a new UC
- the context ref is empty
- link the UC to something (like an association with an actor or a dependency to a requirement)
- the context ref shows the linked elements
I guess EA creates URL-like linking to those elements depending on the same name. At least it looks like that since it creates the URL-link only for connected elements and not for other elements while you type them in the step.
q.
P.S. When you remove the connector, the URL-link also disappears.