|
|
|
Re: [EOL][ETL] Specify Target Model during runtime [message #782943 is a reply to message #781553] |
Tue, 24 January 2012 19:30 |
|
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
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
|
|
Re: [EOL][ETL] Specify Target Model during runtime [message #786547 is a reply to message #781553] |
Mon, 30 January 2012 15:01 |
|
Hi Chris,
Glad it helped. You actually can (as far as I know).
In the execute method of the standalone implementation you create a module, depending on the Epsilon language you are using. You can then use this module to import variables to your execution environment. In the code below I added the null variable to the context (to overcome a bug that existed in EGL). So the first parameter to the createReadOnlyVariable method is the name you will use to identify you variable and the second parameter the value.
public void execute() throws RiskcException {
module = createModule();
module.getContext().getFrameStack().put(Variable.createReadOnlyVariable("null", null));
}
Once in your Epsilon language you can recall the value of the variable by using the name you assigned to it. I haven't looked but there is probably a method to create read/write variables which could be another method to share information between executions. For example this could be another solution to your dynamic model loading issue.
Regards,
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
|
|
|
|
|
Re: [EOL][ETL] Specify Target Model during runtime [message #1831548 is a reply to message #784431] |
Sun, 23 August 2020 01: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.03613 seconds