Book a Demo

Author Topic: how to get tree position defined in project?  (Read 3621 times)

rashwini

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
how to get tree position defined in project?
« on: March 19, 2009, 09:10:22 pm »
Hi,
I m developing adding for exporting element into xml file.

When i export the properties of class, collection order always return me different order.

So came accross another property TPos, which gives tree position.

But when i look into database. this tpos null valu as well and which i felt that tpos does not have correct value.

Or m i missing something.

I need the exact tree position defined in Project Browser for elements , packages, properties of elements , operation parameters position.


tanja

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
Re: how to get tree position defined in project?
« Reply #1 on: August 04, 2012, 06:31:41 pm »
I desperately need this as well; was shocked to see that TPos in t_object table for Class rows may be null (empty) or that value of TPos can be repeated for multiple classes in a package.

The same column in t_package table seems to work ok.

Any help most appreciated !

tanja

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
Re: how to get tree position defined in project?
« Reply #2 on: August 04, 2012, 07:30:42 pm »
I think I found a kind of solution: The symptom and solution is similar to attribute and operation position within a class, that sometimes get screwed (e.g., when you drag an attribute from the project browser into a class in a diagram):

I found that only some packages contain classes whose TPos is 0 or empty (for all classes). I cannot say it's the old parts of the model, because one package is relatively recent and manifests the problem.

In my EA options, I have enabled arbitrary ordering, because for one model that I manage I have to be in control of order for everything.

Now the solution: If I just manually reorder in the project browser one class (e.g. move it a bit down), wait a couple of seconds, then move it back where it was - it seems that this operation triggers some kind of event within EA (a slight flicker in the diagram/search window), and voila - the TPos is now up to date and correct.

I was reporting the problem for attributes position as registered user, and the proposed solution (to do EA db repair) did work. This solution did not work for class' TPos.

I find this really scary.

In any case, if you need order for anything in EA, ensure you do your own checks in the code to identify the bad condition (same value for TPos for multiple items within a container) - and advise the user to manually fix the model by moving up/down items until those TPos fields get updated correctly.


tanja

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
Re: how to get tree position defined in project?
« Reply #3 on: August 04, 2012, 09:01:18 pm »
Update:

The same problem may happen with TPos on t_package.

The same solution (manual reordering back/forth) fixes the problem.