[EOL][ETL] Specify Target Model during runtime [message #781553] |
Sat, 21 January 2012 11:36  |
Eclipse User |
|
|
|
Hi,
I need to write an ETL Transformation from 1 source model to 1 out of 6 possible Target Models. To find the right Target Model, I have a second model, which contains information that are used to determine which Metamodel should be used for the target model.
I would like to use EOL to read the information from the second model and determine which target model is to be used. Is it possible to start the ETL transformation afterwards from within the eol?
Another way I tried to get the problem solved, was by writing an own Ant Task, which reads the information from the second model and sets the property of the Target Metamodel in the Ant file. But as I said, I would like to use eol to do this.
Thanks,
Chris
|
|
|
|
|
Re: [EOL][ETL] Specify Target Model during runtime [message #782943 is a reply to message #781553] |
Tue, 24 January 2012 14:30   |
Eclipse User |
|
|
|
Hi,
You can also take the "stand alone" approach. By executing Epsilon from Java you can query the model that holds the information of the specific target model and then use it to execute the ETL transformations on it. The standalone example needs some tweaking (I can't share my version, sorry), but it would be something in the lines of:
eolExecutor = new EolExecutor("ModelQueries.eol");
eolExecutor.addSourceModelByURI("infoModel", infoModel, "http://MyInfoEcore");
// Query the Model for the correct model for transformation
eolExecutor.executeOperation("getCorrectModel");
model = (String) eolExecutor.getResult();
// Use the imodel name to get the path
String targetModel = MyModelsBasePath + model + ".xmi"
// Execute the transformation
etlExecutor = new EtlExecutor("Transformation.etl");
etlExecutor.addSourceModelByURI("sourceModel", sourceModel, "http://MySourceEcore");
etlExecutor.addTargetModelByURI("targetModel", targetModel, "http://MyTargetEcore");
etlExecutor.execute();
Cheers
|
|
|
|
|
|
|
|
|
Re: [EOL][ETL] Specify Target Model during runtime [message #1831548 is a reply to message #784431] |
Sat, 22 August 2020 21:33  |
Eclipse User |
|
|
|
Chris Martin wrote on Fri, 27 January 2012 14:19Thanks for your help.
I solved my problem by implenting a Java Plugin, which starts the ETL based on the Java standalone example. But now I have one remaining question. Is it possible to import
variables to the ETL transformation? So something like the <uses ref="a" as="b"/> in the Ant workflow, but as a Java method?
Best Regards, Chris
Hi,
is it possible to share the java plugin that you created to solve the issue, or maybe a template of that, that would be helpful. Thank you
|
|
|
Powered by
FUDForum. Page generated in 0.06533 seconds