One model + ETL; multiple targets [message #748286] |
Mon, 24 October 2011 11:57  |
Eclipse User |
|
|
|
Hi
Writing a driver for doing multiple outputs of multiple instances of one
model element type for EGL is documented well in previous post with a
similar title to this post. How would one achieve the same using EGL?
Starting from one model with x number of X elements then generate
multiple models for each X element and persist the new model?
-H
|
|
|
Re: One model + ETL; multiple targets [message #753593 is a reply to message #748286] |
Thu, 27 October 2011 18:04   |
Eclipse User |
|
|
|
Hello,
Quote:How would one achieve the same using EGL? I would asume you ment using ETL .
Quote:Starting from one model with x number of X elements then generate
multiple models for each X element and persist the new model?
Is the number x dynamic or is it known before hand?
If it is known before hand, I have never tried it, but I think something in the lines of this should work: You can use x number of epsilon.emf.loadModel targets in your launch.xml (or epsilon run configuration) to produce multiple output model files. Give each model a unique name, but give them all the same alias. Something like:
<target name="loadModel1">
<epsilon.emf.loadModel
name="model1"
alias="outputModel"
modelfile="model1.xmi"
metamodeluri="http://www.mymetamodel.com"
read="false"
store="store"
/>
</target>
...
<target name="loadModelx">
<epsilon.emf.loadModel
name="modelx"
alias="outputModel"
modelfile="modelx.xmi"
metamodeluri="http://www.mymetamodel.com"
read="false"
store="store"
/>
</target>
Then in your ETL rules use outputModel as the from model identifier.
If x is dynamic... Is there an ant expert who can tell us if ant supports loops? If not, you will be required to use epsilon standalone, i.e. call ETL from java. Look at the epsilon standalone example for etl (in the repository or the website) and modify the java code so that invocation of etl is inside a loop. Using my own implementation of epsilon standalone, it is something in the lines of:
URI inputModel = URI.createFileURI(inputModelFile.getRawLocation().toString());
for(i = 0; i < x; i++ {
URI outputModel = URI.createFileURI("C:/model-gen/model" + i + ".xmi");
EtlExecutor etlExecutor;
etlExecutor = new EtlExecutor("pathToETlSource");
etlExecutor.addSourceModel("inputModel", inputModel, URI.createURI("metamodelIn"));
etlExecutor.addTargetModel("model" + i, outputModel, URI.createURI("metamodelOut"));
etlExecutor.execute();
}
Greetings,
Horacio
|
|
|
|
|
|
Re: One model + ETL; multiple targets [message #1219619 is a reply to message #1215796] |
Wed, 04 December 2013 19:14  |
Eclipse User |
|
|
|
Hi,
Each ETL rule can define only one source (from) role. However, it's possible to transform groups of elements from multiple models that match specific patterns using the pattern language of Epsilon (EPL) + ETL. Could you please elaborate a bit more on your use case so that I can provide more specific guidance?
Cheers,
Dimitris
|
|
|
Powered by
FUDForum. Page generated in 0.04460 seconds