Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [ETL] How to create a target model by java code
[ETL] How to create a target model by java code [message #1625488] Fri, 20 February 2015 12:17 Go to next message
daniele di pompeo is currently offline daniele di pompeoFriend
Messages: 20
Registered: February 2015
Junior Member
Hi to everybody,
i have been using Epsilon ecosystem for a few time

I have read many post in this forum but i have not found anything to help me.

I need to call from java code an etl transformation.

Before, I used the tree2graph.etl file from example by ant script and the transformation succeeded to create a target file, now i would like to reach the same result from java code.

I have seen the example for eunit and i have caught the code to create an empty model

protected EmfModel loadEmptyModel(String name, String metamodelPath)	throws EolModelLoadingException
{
 EmfModel model = new EmfModel();
 model.setName(name);
 model.setMetamodelFileUri(getResourceEmfURI(metamodelPath));
 model.setModelFileUri(URI.createFileURI(new File("Empty" + name + ".model").getAbsolutePath()));
 model.setReadOnLoad(false);
 model.setStoredOnDisposal(false);
 model.load();
 return model;
}


but i can not create a file for this target model after the correct execution of the transformation.

If i create the file from
File file = new File(path);
file.createNewFile();

the file is created in the target folder but it remains empty.

thanks in advance
Re: [ETL] How to create a target model by java code [message #1625495 is a reply to message #1625488] Fri, 20 February 2015 12:21 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Daniele,

Could you please put together a minimal example [1] that demonstrates the issue you're encountering?

Cheers,
Dimitris

[1] http://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Re: [ETL] How to create a target model by java code [message #1625615 is a reply to message #1625488] Fri, 20 February 2015 14:14 Go to previous messageGo to next message
daniele di pompeo is currently offline daniele di pompeoFriend
Messages: 20
Registered: February 2015
Junior Member
here [1] there is the minimal example of my project.

I have used your code for EtlStandaloneExample to understand how epsilon work with the transformation and the models/metamodels.

After launching the transformation the simple program does nothing, instead in the example with ant (tree2Graph) the transformation creates the target model at the end of transformation.

greetings
Daniele
Re: [ETL] How to create a target model by java code [message #1625632 is a reply to message #1625615] Fri, 20 February 2015 14:29 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Daniele,

In your loadEmptyModel method you'll need to replace

model.setStoredOnDisposal(false);


with

model.setStoredOnDisposal(true);


Cheers,
Dimitris
Re: [ETL] How to create a target model by java code [message #1625689 is a reply to message #1625632] Fri, 20 February 2015 15:16 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Daniele,

On a related note, you don't need both epsilon-...-kitchensink.jar and o.e.e.eol.engine.jar in the classpath. The former should suffice.

Cheers,
Dimitris
Re: [ETL] How to create a target model by java code [message #1625800 is a reply to message #1625689] Fri, 20 February 2015 16:53 Go to previous message
daniele di pompeo is currently offline daniele di pompeoFriend
Messages: 20
Registered: February 2015
Junior Member
Thanks dimitris,
now it works fine.

greetings
Daniele
Previous Topic:Assign existing Papyrus model and diagram to a ETL target model and diagram
Next Topic:new icons in Exeed
Goto Forum:
  


Current Time: Sat Apr 27 01:30:53 GMT 2024

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

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

Back to the top