Home » Modeling » Papyrus » dangling steoretypes after deleted stereotyped elements
| | |
Re: dangling steoretypes after deleted stereotyped elements [message #1831082 is a reply to message #1831034] |
Tue, 11 August 2020 11:26 |
|
I'd suggest putting a breakpoint in the didRemove(...) method of the ResourceImpl::ContentEList class. Stereotype applications are contained directly in a resource and are the only things likely to be removed from a resource unless you delete a diagram (except in the case of unloading a resource, which removes all its contents).
HTH,
Christian
|
|
| |
Re: dangling steoretypes after deleted stereotyped elements [message #1831136 is a reply to message #1831083] |
Wed, 12 August 2020 09:31 |
Susanne Fuchs Messages: 27 Registered: March 2020 |
Junior Member |
|
|
Thanks to both of you!
I tried to add the eBasicSetContainer, it did not solve the problem, but maybe I did it wrong, I will try it again later.
In debugging from didRemove(...) I found the following:
First, I realized that I get dangling stereotypes not only for stereotyped elements from my Static Profile and Context, but also when I create an element with a stereotype from a dynamic profile. (I hope I'm using all the terms correctly)
When I have the plug-ins with my architecture context & profile in my workspace, didRemove(...) is not called when I delete an element, and resource is never not null in remove(EObject eObject) in org.eclipse.emf.ecore.util.EcoreUtil
I compared with a workspace WITHOUT these plugins. There, deleting works correctly without the dangling problem. When a stereotyped element is deleted, resource != null for a DynamicEObjectImpl in remove(EObject eObject) in org.eclipse.emf.ecore.util.EcoreUtil
With my plug-ins, doExecuteWithResult(...) in DestroyElementCommand.class is not called at all for a DynamicEObjectImpl when I delete an element from a diagram. doExecuteWithResult(...) is still called for
an OpaqueActionImpl, CSSDecorationNodeImpl, LocationImpl, CSSDecorationNodeImpl,...
I guess this means the DynamicEObject is not deleted? How can I continue with this information?
[Updated on: Wed, 12 August 2020 09:32] Report message to a moderator
|
|
| |
Re: dangling steoretypes after deleted stereotyped elements [message #1831147 is a reply to message #1831136] |
Wed, 12 August 2020 11:48 |
|
Susanne Fuchs wrote on Wed, 12 August 2020 05:31With my plug-ins, doExecuteWithResult(...) in DestroyElementCommand.class is not called at all for a DynamicEObjectImpl when I delete an element from a diagram. doExecuteWithResult(...) is still called for
an OpaqueActionImpl, CSSDecorationNodeImpl, LocationImpl, CSSDecorationNodeImpl,...
I guess this means the DynamicEObject is not deleted? How can I continue with this information?
This is an interesting finding. The StereotypeApplicationAdvice ought to be delegating (indirectly) to the DestroyElementCommand (or some subclass, I suppose) to effect deletion of the applied stereotypes.
Can you debug this advice to see whether it finds stereotype applications to delete and, if not, why not? And if this advice isn't involved in your scenario, then it would be necessary to put a breakpoint in the ElementImpl::eBasicSetContainer method to see what kind of command is actually deleting the element that is leaving the dangling stereotypes behind and trace where that command is coming from, to see why the usual edit-helper advice flow is not happening.
Christian
|
|
| |
Goto Forum:
Current Time: Fri Mar 29 02:10:14 GMT 2024
Powered by FUDForum. Page generated in 0.04158 seconds
|