Book a Demo

Author Topic: State under class owned by package as well?  (Read 2888 times)

tanja

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
State under class owned by package as well?
« on: February 09, 2010, 11:40:48 pm »
I create a state under a class, and Java API (EA 7.1) GetElement method on both class and its containing package return the above state as a child. The same seems to apply to statechart diagram (also defined under a class). I'm surprised to see this implicit containment by package, whereas I expect the class to be the only container.
Any thoughts on this?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8090
  • Karma: +118/-20
    • View Profile
Re: State under class owned by package as well?
« Reply #1 on: February 10, 2010, 08:26:07 am »
The version 8.0 version of the API changes this behavior.  If you can't or don't want to upgrade you can add a check that parentid is zero.
« Last Edit: February 10, 2010, 08:28:46 am by simonm »

tanja

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
Re: State under class owned by package as well?
« Reply #2 on: February 10, 2010, 08:31:08 pm »
Thanx, I confim it worked:
On package.GetElements(), I keep elements (for State) and on package.GetDiagrams(), I keep diagrams (for Statechart) that have parentID=0. This way I skip the others, hopefully I don't miss important stuff...
Anyway, I will certainly be upgrading to version 8 when it gets released as production stable.