Author Topic: attribute order messed up  (Read 351 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7752
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
attribute order messed up
« on: November 16, 2017, 07:12:04 pm »
When deleting attributes the positions of the attributes are not recalculated. This results in inconsistent behavior when adding attributes and changing their order.

This is a serious problem for anyone doing any type of code generation (xml, DDL)

Current workaround is to move the new attribute all the way to the first position and then back. This triggers a recalculation of the position for all attributes.


Steps to Reproduce:
- turn off alphabetic ordering for attributes
- Create class with following attributes
Pos name
----------- ----
0 z
1 q
2 n
3 h
4 a

- Delete "n" and "h" I'm and notice the missing pos 2 and 3

Pos name
----------- ----
0 z
1 q
4 a

- Add "m" to the end and save
- Notice that m has gotten pos 3 and is therefore placed between q and m instead of at the end.

Pos name
----------- ----
0 z
1 q
4 a
3 m

qwerty

  • EA Guru
  • *****
  • Posts: 8972
  • Karma: +136/-124
  • I'm no guru at all
    • View Profile
Re: attribute order messed up
« Reply #1 on: November 16, 2017, 08:07:34 pm »
Arrest the usual suspects.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5882
  • Karma: +71/-79
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: attribute order messed up
« Reply #2 on: November 17, 2017, 10:35:09 am »
I thought you had to do a collection refresh after the deletion so that the collection could be recalculated.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7752
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: attribute order messed up
« Reply #3 on: November 17, 2017, 03:23:50 pm »
I thought you had to do a collection refresh after the deletion so that the collection could be recalculated.

Paolo
Paolo,

I'm talking about regular access via the GUI, no automation.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5882
  • Karma: +71/-79
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: attribute order messed up
« Reply #4 on: November 17, 2017, 07:11:12 pm »
I thought you had to do a collection refresh after the deletion so that the collection could be recalculated.

Paolo
Paolo,

I'm talking about regular access via the GUI, no automation.

Geert
Ah Yes, I'm pretty certain I put in a similar bug report within the last year.

Avagoodweegend!  ;D

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7752
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: attribute order messed up
« Reply #5 on: November 22, 2017, 08:29:51 pm »
Confirmed by Sparx as an issue and logged to be fixed in a future release.

Geert

Guillaume

  • EA User
  • **
  • Posts: 549
  • Karma: +18/-0
    • View Profile
    • www.umlchannel.com
Re: attribute order messed up
« Reply #6 on: November 23, 2017, 06:05:02 pm »
Funny I am just working now on the attributes order for a custom script.

To complete Geert's finding, I changed the attributes order via a script e.g. to update t_attribute.pos values to 1,2,3,4...
Opening the class attributes via the GUI and running a right click > Restore sort order doesn't do anything where it should change them to 0,1,2,3 with the default order (which can be found with the creation order stored in the attribute ID).

« Last Edit: November 23, 2017, 06:16:23 pm by Guillaume »
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com | Automated tests for scripts & addins: www.eatests.com