[Flock] copying vs. moving [message #1066390] |
Tue, 02 July 2013 08:10  |
Eclipse User |
|
|
|
Hi!
In a migration with Flock I want to copy (EObject) elements, i.e.
migrated.x shall be a copy of original.y
It seems to me that Flock moves original.y instead of copying for the following EOL statement:
migrated.x = original.y
If I want to copy original.y and remain the y object in the original model (i.e. not moving y) I found a work around here.
Is it intended in Flock that elements are moved by using "="-assignment?
Or is it due to the fact that I'm using EMF and thus an EObject can have at most one container?
Best regards,
Alex.
|
|
|
|
|
|
|
|
|
Re: [Flock] copying vs. moving [message #1067687 is a reply to message #1067272] |
Wed, 10 July 2013 02:50  |
Eclipse User |
|
|
|
Hi Louis,
this is exactly how I solved it.
Best regards,
Alex.
Louis Rose wrote on Mon, 08 July 2013 03:52Hi Alex,
Flock only supports 1-to-1 mappings between original and migrated elements. To perform a 1-to-2 mapping (or indeed 1-to-N where N>1), the following might work:
migrate MyType {
var emfTool : new Native("org.eclipse.epsilon.emc.emf.tools.EmfTool");
migrated2 = emfTool.getECoreUtil().copy(migrated);
}
I've not tried this, but I presume that you would also need to place "migrated2" into an appropriate container.
If you've not resolved your problem and could put together a minimal example, I can investigate further.
Cheers,
Louis.
|
|
|
Powered by
FUDForum. Page generated in 0.12299 seconds