Complete Delete [message #470956] |
Tue, 20 February 2007 11:56  |
Eclipse User |
|
|
|
I have created my own uml2 editor. When I delete an element from a model
it deletes everything under it accordingly. However, there are somethings
that get orphaned:
- applied stereotypes are not unapplied
- associations are not deleted
- when deleting an associations navigable properties are not deleted from
class elements
Is there already some utility code for handling this? I have started to
write code for doing this, but it is very verbose and I thought there
might be a better way.
Thanks!
|
|
|
|
|
|
|
Re: Complete Delete [message #470964 is a reply to message #470959] |
Wed, 21 February 2007 15:20  |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Kenn, John,
Actually, that would be a pre-commit listener :-)
Post-commit listeners are not permitted to make changes to the model (though
they may read; they are invoked within read-only transactions).
Pre-commit listeners provide commands that will be executed before the
transaction commit completes. This is important, because these changes
also need to be validated by the transaction, and if necessary rolled back.
Cheers,
Christian
Kenn Hussey wrote:
> John,
>
> Are you using the 'Element > Destroy' action? It should unapply the
> stereotypes as well.
>
> With respect to the associations, and other similar semantic
> relationships, you could consider using the transaction functionality
> provided by EMFT and register a post-commit listener that does this kind
> of clean-up when transactions are closed...
>
<snip>
|
|
|
Re: Complete Delete [message #588947 is a reply to message #470956] |
Tue, 20 February 2007 13:07  |
Eclipse User |
|
|
|
John,
Element#destroy() will destroy the stereotype applications (and all
incoming/outgoing references). However, destruction of "indirectly" related
elements like associations of which navigable members end are part is
application-specific and thus something you'll need to provide your own
mechanism for...
Kenn
"John Gilbert" <jgilbert01@yahoo.com> wrote in message
news:9c3664a852dc982cd25f2652f04a0e5a$1@www.eclipse.org...
>I have created my own uml2 editor. When I delete an element from a model it
>deletes everything under it accordingly. However, there are somethings that
>get orphaned:
> - applied stereotypes are not unapplied
> - associations are not deleted
> - when deleting an associations navigable properties are not deleted from
> class elements
>
> Is there already some utility code for handling this? I have started to
> write code for doing this, but it is very verbose and I thought there
> might be a better way.
>
> Thanks!
>
|
|
|
Re: Complete Delete [message #588959 is a reply to message #470957] |
Tue, 20 February 2007 14:15  |
Eclipse User |
|
|
|
Hmmm. Even with the out of the box uml tree editor the stereotypes are not
unapplied on delete. They still show up at the bottom of the file when
opened with a text editor.
Any suggestions on a graceful way to handle the associations?
|
|
|
Re: Complete Delete [message #588971 is a reply to message #470958] |
Tue, 20 February 2007 22:53  |
Eclipse User |
|
|
|
John,
Are you using the 'Element > Destroy' action? It should unapply the
stereotypes as well.
With respect to the associations, and other similar semantic relationships,
you could consider using the transaction functionality provided by EMFT and
register a post-commit listener that does this kind of clean-up when
transactions are closed...
Kenn
"John Gilbert" <jgilbert01@yahoo.com> wrote in message
news:de67f9b6ba248edacd4b701f3504277e$1@www.eclipse.org...
> Hmmm. Even with the out of the box uml tree editor the stereotypes are not
> unapplied on delete. They still show up at the bottom of the file when
> opened with a text editor.
>
> Any suggestions on a graceful way to handle the associations?
>
|
|
|
|
Re: Complete Delete [message #589052 is a reply to message #470959] |
Wed, 21 February 2007 15:20  |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Kenn, John,
Actually, that would be a pre-commit listener :-)
Post-commit listeners are not permitted to make changes to the model (though
they may read; they are invoked within read-only transactions).
Pre-commit listeners provide commands that will be executed before the
transaction commit completes. This is important, because these changes
also need to be validated by the transaction, and if necessary rolled back.
Cheers,
Christian
Kenn Hussey wrote:
> John,
>
> Are you using the 'Element > Destroy' action? It should unapply the
> stereotypes as well.
>
> With respect to the associations, and other similar semantic
> relationships, you could consider using the transaction functionality
> provided by EMFT and register a post-commit listener that does this kind
> of clean-up when transactions are closed...
>
<snip>
|
|
|
Powered by
FUDForum. Page generated in 0.07968 seconds