replace object without [message #1791501] |
Sun, 01 July 2018 08:38 |
Michiel Fortuin Messages: 9 Registered: May 2018 |
Junior Member |
|
|
Hi,
Is it possible to replace an object in a model by a sister object(their classes have a common supertype), without knowing their container class?
A small example:
So A1, A2, A3, ..., Ai has a containment relation to B.
B is an abstract class.
C and D extends B.
And if an C exist then it should be replaced by D, without defining in which container C resides.
Also in my case the number of containers (e.g. A1, A2, etc) is quite large, so it would help to have a general solution.
Thanks in advance,
Michiel
|
|
|
Re: replace object without [message #1791516 is a reply to message #1791501] |
Sun, 01 July 2018 16:40 |
|
Hi Michiel,
The main challenge with replacing an EObject is that all other EObjects that point to it (through containment and non-containment EReferences) need to be updated as well. This should be possible using the reflective EMF API but I'm not aware of an out-of-the-box solution.
Cheers,
Dimitris
|
|
|
Powered by
FUDForum. Page generated in 0.02830 seconds