Skip to main content



      Home
Home » Modeling » Epsilon » Epsilon ETL - Ecore2Ecore full copy
Epsilon ETL - Ecore2Ecore full copy [message #1841123] Tue, 04 May 2021 09:09 Go to next message
Eclipse UserFriend
Hi, i have an Ecore file called "PS.ecore" that contains a big structure with a root element called "root". Is possible, using ETL, to create a full copy of PS.ecore starting from root into another ecore file called migrated.ecore? If is possible, can you show me the code? I'm a begineer in ETL, i'm sorry for my english. Thanks.
Re: Epsilon ETL - Ecore2Ecore full copy [message #1841125 is a reply to message #1841123] Tue, 04 May 2021 09:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi Daniele,

Could you please describe how the migrated Ecore file should be different to the original Ecore file? If you could attach a concrete example in Ecore/Emfatic [1] that would help a lot.

Best,
Dimitris

[1] https://www.eclipse.org/emfatic/
Re: Epsilon ETL - Ecore2Ecore full copy [message #1841126 is a reply to message #1841125] Tue, 04 May 2021 09:23 Go to previous messageGo to next message
Eclipse UserFriend
Hi again,

If you're just looking to copy the metamodel, you can replace

original.setMetamodelFile(modelsRoot.resolve("Tree.ecore").toAbsolutePath().toString());
original.setModelFile(modelsRoot.resolve("Tree.xmi").toAbsolutePath().toString());
...
migrated.setMetamodelFile(modelsRoot.resolve("Tree.ecore").toAbsolutePath().toString());
migrated.setModelFile(modelsRoot.resolve("Tree.migrated.xmi").toAbsolutePath().toString().replace("/target/classes/", "/src/"));


with

original.setMetamodelUri(EcorePackage.eINSTANCE.getNsURI());
original.setModelFile(modelsRoot.resolve("Tree.ecore").toAbsolutePath().toString());
 		original.load();
...
migrated.setMetamodelUri(EcorePackage.eINSTANCE.getNsURI());
migrated.setModelFile(modelsRoot.resolve("Tree.migrated.ecore").toAbsolutePath().toString().replace("/target/classes/", "/src/"));


in the example in [1].

Best,
Dimitris

[1] https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/tree/examples/org.eclipse.epsilon.examples.standalone/src/org/eclipse/epsilon/examples/standalone/flock/FlockStandaloneExample.java
Re: Epsilon ETL - Ecore2Ecore full copy [message #1841197 is a reply to message #1841126] Thu, 06 May 2021 05:47 Go to previous messageGo to next message
Eclipse UserFriend
Hi Dimitris,
i need just a copy of the metamodel, but i want to do it using only ETL code without usgin java. Do you think that is possible? Thanks.

Daniele
Re: Epsilon ETL - Ecore2Ecore full copy [message #1841198 is a reply to message #1841197] Thu, 06 May 2021 05:57 Go to previous message
Eclipse UserFriend
Hi Daniele,

Yes - my answer on Stackoverflow [1] re Flock also applies to ETL. However, I should note that ETL would be a poor choice of language for this task as it would require you to explicitly write all rules to copy elements across (e.g. EClass2EClass, EAttribute2EAttribute etc.). Flock is much more suitable for this task.

Best,
Dimitris

[1] https://stackoverflow.com/questions/67354310/epsilon-model-migration-flock-full-copy/67368628#comment119146970_67368628
Previous Topic:Exporting ECL Traces in Ant Tasks
Next Topic:[Evl] Eclipse MessageDialog Errors
Goto Forum:
  


Current Time: Sun Jul 13 10:30:15 EDT 2025

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

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

Back to the top