Book a Demo

Author Topic: Constraints deleted when package gets deleted  (Read 4642 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Constraints deleted when package gets deleted
« on: July 30, 2009, 08:01:44 pm »
I've found a very disturbing bug.
When I add a constraint to a diagram, then move the diagram to another package, and then delete the original package the constraint is deleted as well.
Apparently the constraint is defined as a child element of the package, but it is not shown on in the project browser.
When the parent package of a constraint is deleted the constraint itself is deleted as well, and since I cannot see the constrain in the project browser there is no way to move the constraint to another package before deleting the original package.

Auch...

I've reported this to Sparx Support.

Geert

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Constraints deleted when package gets deleted
« Reply #1 on: July 31, 2009, 03:01:35 am »
Ouch!

This is one case where a shortcut in design (moving related things uses the Project Browser tree instead of the 'real' hierarchy) comes back to bite us...
No, you can't have it!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Constraints deleted when package gets deleted
« Reply #2 on: October 05, 2009, 06:46:09 pm »
Tested again and it is fixed in version 7.5.849

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Constraints deleted when package gets deleted
« Reply #3 on: October 05, 2009, 06:54:15 pm »
Quote
Tested again and it is fixed in version 7.5.849

Geert
Hi Geert,

Just interested, how was it fixed?  You DO mean constraints on one or more connectors yes?

Does the constraint become a child of the new package or what?  If, as I often do, I have the same constraint (copy & pasted) on more than one diagram in more than one package how can I still stop this?

TIA,
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: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Constraints deleted when package gets deleted
« Reply #4 on: October 05, 2009, 07:02:33 pm »
Yes I mean the constrains which look a bit like notes, connected to relations or elements.
I believe the constraint is considered to be owned by the diagram.(which in my view is plain WRONG, but that's a whole other issue).
Before when the diagram was moved the constraint wasn't moved with it, it was somehow left in the package where the diagram resided before. (they probably forgot to update the packageID field).
Now when a Package is deleted I can image that the code looks for all things that have the id of the package in their packageID field and delete those, which led to this issue.

Anyway, now it works fine.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Constraints deleted when package gets deleted
« Reply #5 on: October 05, 2009, 09:28:11 pm »
Quote
Yes I mean the constraints which look a bit like notes, connected to relations or elements.
I believe the constraint is considered to be owned by the diagram.(which in my view is plain WRONG, but that's a whole other issue).
[size=18]...[/size]
Anyway, now it works fine.
I agree that it's wrong to consider the constraint to be owned by the diagram.

And it doesn't work fine now... It just works OK for the simple case (constraint visible on only ONE diagram).  It isn't safe enough for my case.  If I delete one package, the constraint remains, if I delete a different package, the constraint is purged...   :(

It's all part of the problem where certain elements are NOT considered 1st class citizens of the repository.

I see no reason why constraints shouldn't be made visible in the browser (using a synthetic name initially - which could be replaced by a formal name later).

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: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Constraints deleted when package gets deleted
« Reply #6 on: October 05, 2009, 09:58:29 pm »
You are right, I doesn't work fine, it works as designed :-/
If you really think about it, a diagram should not be able to own anything UML. (only things like text or shapes could be owned by diagrams)
I'm thinking about a request to ask for:
- Remove all diagram owned UML items and move them to a sensible owner (the containing package most of the times)
- Show ALL UML items in the model tree view
- As a nice to have: create an option to choose which types of elements should be shown in the model tree view.

What do you think?

Geert

PS. With "UML item" I mean anything that is defined in UML. I have not used the word "element" or "artifact" because those are already overloaded.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Constraints deleted when package gets deleted
« Reply #7 on: October 05, 2009, 10:08:08 pm »
I agree!

Especially the last point...  I'd make it more than a nice to have.  The amount of stuff you need to traverse on a browser tree can be quite considerable and slow you down a lot.  Being able to filter what is seen to what you're currently (or potentially working with) would be a BIG productivity boost.

As with all these kinds of things, it's my view that the user should be able to specify named configurations.  That would then allow them to switch filters easily and consistently.

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