Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: bo on May 24, 2004, 05:34:22 pm
-
Hi
Please advise correct procedure to create brand new sequence diagram using the Automation interface.
I’d like to produce the same objects as per UI sequence diagram creation.
I have all classes created.
Major problem for me is the ‘UML:ClassifierRole’ element (see the XMI fragmet attached) referenced in the diagram. I can’t instantiate proper object for the UML:ClassifierRole. I can reference a class directly, but it seems to be not a standard way in the EA (see C# snippet):
EA.DiagramObject diaobj = diag.DiagramObjects.AddNew("l=10;r=90;t=10;b=600;", "") as EA.DiagramObject;
diaobj.DiagramID = diag.DiagramID;
diaobj.ElementID = e.ElementID;
where: diag – current sequence diagram
e - EA.Element of the requred class.
Here is a XMI fragment from manually created SD that I’d like to replicate automatically:
<UML:ClassifierRole xmi.id="EAID_17EE61F2_715D_482a_BDD9_0CC1FBCBA3DF" visibility="public" base="EAID_11111111_5487_4080_A7F4_41526CB0AA00">
<UML:ModelElement.taggedValue>
…
<UML:TaggedValue tag="classifier" value="EAID_3A51A629_1C36_4b0d_9FE9_C23A5A82DF8C"/> <!—real class REF -->
…
</UML:ModelElement.taggedValue>
</UML:ClassifierRole>
…
<UML:Diagram.element>
<UML:DiagramElement geometry="Left=421;Top=50;Right=511;Bottom=350;" subject="EAID_17EE61F2_715D_482a_BDD9_0CC1FBCBA3DF" seqno="1"/>
…
Regards,