Hello,
I'm using Java to create Elements and Connector in a package and in a diagram.
This is working fine.
When I open the model with EA, I can see my components and the link between them.
But when I'm in EA (version 9.3), something is not working:
In fact, when I create a new diagram, and drag and drop my two components in the new diagram. The components are well shown, but the link is not there.
When I'm under the diagram created with java, I can see in the properties "Related/Links" of the elements that I'm able to see a menu option called "Hide Relation".
This option is not there when I'm in the diagram created with EA.
-----------
The structure of the tree of Project Browser looks like this:
Model (created with java)
- Package 1 (created with java)
- Package 11 (created with java)
- Diagram 1 (created with java)
- Diagram 2 (created with EA)
- component A (created with java)
- component B (created with java)
component A and B are visible in Diagram 1 and 2.
A link (an assembly relationship) is created and visible in diagram 1, but not in diagram 2.
----
Element sourceElement = FindElement(source.getName(), p);
Element destinationElement = FindElement(destination.getName(), p);
Connector connector = sourceElement.GetConnectors().AddNew("", "Assembly");
connector.SetName(linkName);
connector.SetSupplierID(sourceElement.GetElementID());
connector.SetClientID(destinationElement.GetElementID());
connector.SetDiagramID(diagram.GetDiagramID());
connector.Update();
sourceElement.Refresh();
destinationElement.Refresh();
p.GetConnectors().Refresh();
DiagramLink diagramLink = diagram.GetDiagramLinks().AddNew("", "");
diagramLink.SetConnectorID(connector.GetConnectorID());
diagramLink.SetDiagramID(diagram.GetDiagramID());
diagramLink.SetIsHidden(false);
diagramLink.Update();
diagram.GetDiagramLinks().Refresh();
diagram.Update();
---
When I export the diagrams in XML :
I have something different with the link created through java, that if I do it directly with EA.
it's:
<extendedProperties virtualInheritance="0" diagram="EAID_47AD417E_1566_4a1a_AD9F_044E03D0A165" privatedata5="EDGE=4;SX=35;SY=13;EX=35;EY=13;"/>
from:
<connector xmi:idref="EAID_DF7A2A95_49FE_40a1_833F_F3730877F11C">
<source xmi:idref="EAID_58E24A71_430A_440f_838E_70A82B15F12A">
<model ea_localid="4" type="Component" name="composant B"/>
<role visibility="Public" targetScope="instance"/>
<type aggregation="none" containment="Unspecified"/>
<constraints/>
<modifiers isOrdered="false" changeable="none" isNavigable="false"/>
<style value="Navigable=Unspecified;Union=0;Derived=0;AllowDuplicates=0;Owned=0;"/>
<documentation/>
<xrefs/>
<tags/>
</source>
<target xmi:idref="EAID_C9DAE6DC_167D_4e21_BFC9_915116491B30">
<model ea_localid="3" type="Component" name="composant A"/>
<role visibility="Public" targetScope="instance"/>
<type aggregation="none" containment="Unspecified"/>
<constraints/>
<modifiers isOrdered="false" changeable="none" isNavigable="true"/>
<style value="Navigable=Navigable;Union=0;Derived=0;AllowDuplicates=0;Owned=0;"/>
<documentation/>
<xrefs/>
<tags/>
</target>
<model ea_localid="1"/>
<properties ea_type="Assembly" direction="Source -> Destination"/>
<documentation/>
<appearance linemode="3" linecolor="-1" linewidth="0" seqno="0" headStyle="0" lineStyle="0"/>
<labels mt="lien"/>
<extendedProperties virtualInheritance="0" diagram="EAID_47AD417E_1566_4a1a_AD9F_044E03D0A165" privatedata5="EDGE=4;SX=35;SY=13;EX=35;EY=13;"/>
<style/>
<xrefs/>
<tags/>
</connector>
when I replace that line with :
<extendedProperties virtualInheritance="0" />
and import it back in EA, my link is working again.
So I would like to know what I've done wrong (or not done) in Java so that I have this extendedProperties that makes my link not visible in other diagrams, and not even able to change that through EA.
Thanks in advance for any help on this.
Regards,
Kevin