Book a Demo

Author Topic: Problem After Export of Model to 2nd EA-Instance  (Read 2594 times)

blue5teel

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Problem After Export of Model to 2nd EA-Instance
« on: January 29, 2009, 07:52:54 pm »
The Export works fine, except some Details i mentioned in another post.
The second EA-Instance shows every Content of the imported Model correctly. Every package, diagram and element is contained.

But ive got a problem if i access (EA Api) the diagrams of the second repository, which holds the imported stuff.

I loop through all packages and their diagrams. I acces diagrams in the following way, like i always did:

Code: [Select]
EA.Package p = RootPackage;
                Logging.Write("Package: " + p.Name);

                     foreach(EA.Diagram d in p.Diagrams)
                    {
                        //TODO: Für den Fall, dass ein Paket nur ein Diagramm enthalten sollte, solltest du für das Paket-Chapter-Element das Diagramm mit einfügen. Bedenke die Besonderheiten bei der Kapitel-Stufe.

                        Logging.Write("     Diagram: " + d.Name);
                    }

The Diagram-Collections are containing the correct number of diagrams. But only every second diagram of the actiual diagrams. Remember that the diagrams are displayed correctly in EA.

Here is an example:
I have diagrams:
  • Classdiagram_1
  • Classdiagram_2
  • Classdiagram_3
  • Classdiagram_4
But the Collection "Package.Diagrams" contains:
  • Classdiagram_1
  • Classdiagram_3
  • Classdiagram_1
  • Classdiagram_3
What is the problem here ?

blue5teel

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Problem After Export of Model to 2nd EA-Instan
« Reply #1 on: January 30, 2009, 01:14:22 am »
Sorry, i caused the problems with the diagram-order.

I use a for-loop where i move diagrams from a container into another container, do some computation and move them back.

Its a bad idea to change the contents of a container while you loop through it.  :-[

Used nearly a day for finding the bug. Or I better dont call it a bug. Its more inferior programming-expertise.

thankyou anyway....
« Last Edit: January 30, 2009, 01:15:37 am by blue5teel »