[ATL] running transformations programatically with superimpose [message #91114] |
Thu, 02 October 2008 19:15  |
|
Hi,
i have a transformation that uses another transformation as superimposed
transformation. In the ATL plugin this transformation runs perfectly, and
programatically if i copy the superimposed transformation into the main
transformation, it works too.
But i dont know how programatically run a transformation with a
superimposed transformation. Someone knows how or has an example?
Thanks in advance.
Waldemar
|
|
|
Re: [ATL] running transformations programatically with superimpose [message #91144 is a reply to message #91114] |
Fri, 03 October 2008 08:33   |
Gabriel BARBIER Messages: 106 Registered: July 2009 |
Senior Member |
|
|
Here is a basic example :
UML2Copy is the basic transformation
DependenciesCreation extends UML2Copy
URL basicTransformation = this.getClass().getResource(
transformationsLocation + "/UML2Copy.asm"
);
URL superimposedTransformation = this
getClass().getResource(
transformationsLocation +
"/DependenciesCreation.asm");
final Map<String, ASMModel> models = new HashMap<String,
ASMModel>();
final Map<?, ?> asmParams = Collections.EMPTY_MAP;
final List<URL> superimpose = new ArrayList<URL>();
Map<String, String> options = new HashMap<String,
String>();
final Map<?, ?> libs = Collections.EMPTY_MAP;
// metamodels
models.put("UML2", umlMM);
// source models
models.put("IN", umlSourceModel);
// target model
models.put("OUT", outputInstance);
// options
options.put("continueAfterError", "true");
options.put("AllowInterModelReferences", "true");
// superimpose
superimpose.add(superimposedTransformation);
/*
* Lancement de la transformation
*/
final AtlLauncher launcher = AtlLauncher.getDefault();
launcher.launch(basicTransformation, libs, models,
asmParams,
superimpose, options);
Regards,
Gabriel
|
|
|
|
Powered by
FUDForum. Page generated in 0.02253 seconds