Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Rob7795 on March 01, 2005, 09:45:12 pm

Title: Traversing interaction occurrence references
Post by: Rob7795 on March 01, 2005, 09:45:12 pm
Hi folks,

I'm using C# to traverse a UML model.  I have a sequence diagram (A) with an interaction occurrence (a reference to another sequence diagram (B)).

When traversing DiagramA, I discover the DiagramObject that references an element whose type is "InteractionOccurrence".

However, I cannot determine what DiagramB is from the information stored in the element.  That is, I don't know how to de-reference the interaction occurrence.

Ultimately, I want to visit all objects on the referenced sequence diagram.

Can anyone give me some advice as to what objects, methods, properties, etc. I should be using to access this diagram?

Cheers, Rob.
Title: Re: Traversing interaction occurrence references
Post by: KP on March 02, 2005, 01:54:53 pm
Hi Rob,

Looking at the database structure, it appears that when an element is an interaction occurrence, the PDATA1 field contains the diagram ID of the referenced diagram. PDATA1 in the database translates to MiscData(0) in the Automation Interface. Search for "MiscData" in the help file for more info.

HTH

Neil
Title: Re: Traversing interaction occurrence references
Post by: Rob7795 on March 02, 2005, 03:05:39 pm
Neil,

Thanks heaps - works a treat.

The C# code to access this is:

Code: [Select]

// repository = a handle to the repository object
// element = represents the interaction occurrence on the diagram

EA.Diagram interactionOccurrence = repository.GetDiagramByID(int.Parse(element.get_MiscData(0)));


Cheers, Rob.