Author Topic: Exception & crash when using Repository.GeElemementByID()  (Read 128 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7727
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Exception & crash when using Repository.GeElemementByID()
« on: September 28, 2017, 04:03:33 pm »
In very specific circumstances using Repository.GetElementByID() by an add-in results in a stackoverflow or other non recoverable exception, resulting in the immediate shutdown of EA.

The weird thing is that it worked just fine seconds before, but apparently, right after clicking OK on the connector dialog, the system is in some kind of corrupted state and is not able anymore to get the element by it's ID


Steps to Reproduce:
- Create new class by dragging class icon from toolbox onto diagram that already contains another class
- Press OK on the dialog box for the class (resulting in something like Class1 with no other details)
- Select the association connector from the toolbox and drag the new association from the new class to an existing class.
- Doubleclick on the association and fill in source role, target role, source multiplicity and target multiplicity
- Press OK
- Now immediately use the function Repository.GetElementByID() in an add-in with the ID of the new class. Notice that EA crashes.

You can also see the result when using a script. right before opening the connector dialog it works just fine. Right after closing the dialog the script reports an error (but for some reason now EA doesn't crash)

Bug reported.

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7727
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Exception & crash when using Repository.GeElemementByID()
« Reply #1 on: October 03, 2017, 05:55:32 pm »
Confirmed as a bug and awaiting fixing.

Geert