Author Topic: Traversing interaction occurrence references  (Read 4285 times)

Rob7795

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Traversing interaction occurrence references
« 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.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Traversing interaction occurrence references
« Reply #1 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
The Sparx Team
[email protected]

Rob7795

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Traversing interaction occurrence references
« Reply #2 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.