|
|
|
Re: Deep copy of model element [message #1284547 is a reply to message #1284465] |
Fri, 04 April 2014 15:51 |
|
Hi Vlad,
Off the top of my head, a workaround you could use would be to define target as a sequence and then add the cloned element to it i.e.
rule DeepCopy
transform source : Source!Class
to target : Sequence {
var emfTool : new Native("org.eclipse.epsilon.emc.emf.tools.EmfTool");
var target = emfTool.getECoreUtil().copy(source);
targets.add(target);
// Add the new element to the Target resource
// Since you're adding elements to the resource directly you'll need to un-tick the cache
// option in Target's model configuration dialog
Target.resource.contents.add(target);
}
Alternatively, using EOL would also make sense.
Cheers,
Dimitris
[Updated on: Fri, 04 April 2014 15:54] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02065 seconds