Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Copy operation of org.eclipse.epsilon.emc.emf.tools.EmfTool
Copy operation of org.eclipse.epsilon.emc.emf.tools.EmfTool [message #1405634] Thu, 07 August 2014 20:50 Go to next message
Mahsa P is currently offline Mahsa PFriend
Messages: 115
Registered: July 2013
Senior Member
Hi,
I have two models (Model1,Model2)in my ETL code. When I use the copy operation of the 'org.eclipse.epsilon.emc.emf.tools.EmfTool' tool, which model is selected for target of the copy operation? My code is :
var temp:= Model2.createInstance(Model1.type().name);
	var emfTool : new Native("org.eclipse.epsilon.emc.emf.tools.EmfTool");
	var n := emfTool.getECoreUtil().copy(temp);

After running the this code, is temp copied to Model1 or model2? How can I manage it?

Best Regards.

Re: Copy operation of org.eclipse.epsilon.emc.emf.tools.EmfTool [message #1405830 is a reply to message #1405634] Fri, 08 August 2014 09:15 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2182
Registered: July 2009
Location: York, UK
Senior Member

Hi Mahsa,

At this point the clone does not belong to either model. To add it to a model you'll need to either add it to the contents of the resource that underpins it (e.g. Model1.resource.contents.add(n)), or add it to a containment reference of a model element that already belongs to that model. Please note that if you're cloning elements you'll need to disable the "Cache..." option in the model configuration dialog.

Cheers,
Dimitris
Re: Copy operation of org.eclipse.epsilon.emc.emf.tools.EmfTool [message #1406183 is a reply to message #1405830] Sat, 09 August 2014 08:37 Go to previous message
Mahsa P is currently offline Mahsa PFriend
Messages: 115
Registered: July 2013
Senior Member
Thanks dear Dimitris.
Previous Topic:[EuGENia] Resource contains no diagram
Next Topic:EVL: unset elements (enum) in XML instance evaluated
Goto Forum:
  


Current Time: Mon Sep 23 00:03:11 GMT 2024

Powered by FUDForum. Page generated in 0.02882 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top