Bug 129859 - XMI file contains deleted associations
Summary: XMI file contains deleted associations
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
: 140612 (view as bug list)
Depends on:
Reported: 2006-06-26 19:14 UTC by Benjamin Heitmann
Modified: 2007-02-13 07:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:

this XMI file has two associations in the XMI.content section but only one in the UML diagram (108.16 KB, text/plain)
2006-06-26 19:21 UTC, Benjamin Heitmann

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Heitmann 2006-06-26 19:14:35 UTC
Version:           1.5.3 (using KDE KDE 3.5.2)
Installed from:    Debian testing/unstable Packages
OS:                Linux

The XMI File of a Model, which was created in Umbrello and then saved contains all 
deleted (and current) associations between classes in the <XMI.content> part.

I did not look at the <XMI.extensions> part, but I assume that the deleted associations are not included in that part, because the visual representation of the UML diagramm, which is displayed by Umbrello is correct. 

To recreate this bug, just follow these simple steps: 

1.) Create a new UML document with ctrl+n
2.) Create a new UML class diagram.
3.) Create two new classes in the diagram. 
4.) create an Aggregation association between the two classes.
5.) Click on the Aggregation and delete it. 
6.) create a Composition association between the two classes.
7.) save the UML file
8.) check the saved file and there are two <UML:Assocation> elements below <XMI.content> and not one. (There is no way to decide which of the two is the current one.

This bug is really bad, for people trying to generate source code from the XMI file :P 

I will attach a sample XMI file to this bug, as soon as I see how to do that.
Comment 1 Benjamin Heitmann 2006-06-26 19:21:55 UTC
Created attachment 16796 [details]
this XMI file has two associations in the XMI.content section but only one in the UML diagram

the attachment demonstrates the bug
Comment 2 Fabien Catteau 2006-08-24 17:50:17 UTC
Same problem with UML:Generalization and UML:Abstraction. When I remove a generalization or an abstraction in the diagram, it's still in the XMI file (in the UML:Model tree).

I've looked for a way to remove the generalization/abstraction/association in the model using the GUI but I can't find any.

For me, it's a GUI issue. It's correct to keep things in the model when we remove them in the diagram. But there should be a way to edit the model. Two possible solutions :

- add associations, generalizations and associations in the "logical view"	part of the left tree (so it would be possible to delete them)
- in the diagram editor, add a shorcut that means "remove in the diagrame AND in the model"

In Rational Rose, the model components like associations appear in a "model tree", and so it is possible to remove them. And in the diagram editor there are two ways to remove something :

- the "delete" key means "remove in the diagram"
- the Control-d shortcut means "remove both in the diagram AND in the model"

This is a big issue for me cause I've written a kind code generator that reads the XMI file. So right now I've got to clean up the XMI by hand.

Thank you for your work, umbrello is great !

umbrello version : 1.5.2
distro version : kubuntu 6.0.6
Comment 3 Oliver Kellogg 2006-08-27 10:33:52 UTC
I'll try to look into this as soon as the 3.5 branch is back to stable
Comment 4 Oliver Kellogg 2006-09-17 17:24:52 UTC
I followed the steps you gave but I can't recreate the problem
using branches/KDE/3.5/umbrello of today.
Could you try again - if possible with the current 3.5 branch version?
Comment 5 Rico Schiekel 2006-10-11 15:59:14 UTC
I simple follow the steps mentioned by Benjamin Heitmann and can produce the same behavior.
there are two <UML:Assocation> elements (aggregation="aggregate" _and_ aggregation="composite") below <XMI.content> and not only the composite aggregation. so, the xmi is broken.
in the <XMI.extensions> part, there is only the Composition association, which is then correctly displayed in the gui.

debian testing
umbrello: 3.5.2-1+b2
kdelibs-data: 3.5.4-3
kdelibs4c2a: 3.5.4-3
Comment 6 Oliver Kellogg 2006-10-11 17:00:02 UTC
> I simple follow the steps mentioned by Benjamin Heitmann and can produce
> the same behavior.
> [...]
> umbrello: 3.5.2-1+b2

It's very possible there was a problem in 1.5.2.
I believe this has been fixed, at least I can't confirm using
1.5.4 and 1.5.5.
Comment 7 Rico Schiekel 2006-10-12 18:20:39 UTC
I've tested it just now with umbrello version 1.5.5 and the problem is not fixed. there is still the deleted aggregation association in the <XMI.content>.

Qt: 3.3.6
KDE: 3.5.5
Umbrello UML Modeller: 1.5.5
Comment 8 Oliver Kellogg 2006-10-24 10:05:57 UTC
Finally I was able to reproduce the bug and it is fixed by commit 598502
on branches/KDE/3.5/kdesdk/umbrello/umbrello/umlcanvasobject.cpp:
> removeAllAssociations(): Do not increment the iterator when positioned on an
> association. Remove the association from m_List unconditionally.

Comment 9 Marko Schuetz Schmuck 2006-12-27 22:59:58 UTC
this seems related (or even the same) as 100142
Comment 10 Oliver Kellogg 2006-12-27 23:48:25 UTC
> this seems related (or even the same) as 100142
Are you saying that it's still happening for you on current branches/KDE/3.5/kdesdk? If so then feel free to reopen.
Comment 11 Oliver Kellogg 2007-02-13 07:29:24 UTC
*** Bug 140612 has been marked as a duplicate of this bug. ***