[AM3] Is there any doc on AM3? [message #374305] |
Wed, 04 March 2009 09:34  |
Eclipse User |
|
|
|
Hi, i'm new to AM3, i'm trying to find documentation on how to use it.
for example, in the megamodel navigator, when we add a metametamodel how
can we link it to EMF? And when we create a metamodel what are the
{locator, sourceof, targetOf and relatedTo} Stuff?
i'm trying to inject an ATL model from an ATL file, they told me that the
AM3 guys do this very well. I would like to know more about this project.
thanks
|
|
|
|
Re: [AM3] Is there any doc on AM3? [message #374308 is a reply to message #374307] |
Fri, 13 March 2009 04:25  |
Eclipse User |
|
|
|
thanks a lot ronan but i needed to do that at runtime, i have a
transformation from a uml model to an AADL model, and i want to add as
much output models in the ATL transformation as instanceSpecifications in
the UML model, this is because each instance specification in AADL must be
in a separate model (file), so i wanted to make a first transformation
(High-Order) that will add these rules to my core transformation before i
launch it. I tried this code to inject an atl file into an atl model:
AtlModelHandler amh = AtlModelHandler.getDefault(AtlModelHandler.AMH_EMF);
ModelFactory factory = CoreService.createModelFactory("EMF");
IReferenceModel atlMM = factory.newReferenceModel();
System.out.println(CoreService.getInjectorsNames());
IInjector injector = CoreService.getInjector("EMF"); //new ASMInjector();
injector.inject(atlMM, atlMMpath);
InputStream input = new FileInputStream(uri);
//Now Parsing from atl file to atl model
//Create a new parser
AtlParser atlParser = AtlParser.getDefault();
//Create a new ASMModel
ASMModel atlASMModel = null;
amh.createModelLoader().newModel("Marte2ATL", "file:/" + uri,
atlASMModel);
//Launch Parsing
atlASMModel = atlParser.parseToModel(input);
//Save to .ecore
atlASMModel.getModelLoader().save(atlASMModel, destination);
THIS CODE GAVE ME AN ATL MODEL IN AN ECORE FILE BUT I DON'T KNOW YET IF
AFTER THE HIGH ORDER TRANSFORMATION IT WILL BE RECOGNIZED AS A VALID ATL
TRANSFORMATION, I'M NOT THERE YET.
|
|
|
Re: [AM3] Is there any doc on AM3? [message #563830 is a reply to message #374305] |
Thu, 12 March 2009 13:28  |
Eclipse User |
|
|
|
Hi Skander,
If you want some help with an ATL->ATL transform you can send me your
files and I can try and run them on my setup using ANT. I'll report back
the finding on this newsgroup.
Cheers,
Ronan
|
|
|
Re: [AM3] Is there any doc on AM3? [message #563852 is a reply to message #374307] |
Fri, 13 March 2009 04:25  |
Eclipse User |
|
|
|
thanks a lot ronan but i needed to do that at runtime, i have a
transformation from a uml model to an AADL model, and i want to add as
much output models in the ATL transformation as instanceSpecifications in
the UML model, this is because each instance specification in AADL must be
in a separate model (file), so i wanted to make a first transformation
(High-Order) that will add these rules to my core transformation before i
launch it. I tried this code to inject an atl file into an atl model:
AtlModelHandler amh = AtlModelHandler.getDefault(AtlModelHandler.AMH_EMF);
ModelFactory factory = CoreService.createModelFactory("EMF");
IReferenceModel atlMM = factory.newReferenceModel();
System.out.println(CoreService.getInjectorsNames());
IInjector injector = CoreService.getInjector("EMF"); //new ASMInjector();
injector.inject(atlMM, atlMMpath);
InputStream input = new FileInputStream(uri);
//Now Parsing from atl file to atl model
//Create a new parser
AtlParser atlParser = AtlParser.getDefault();
//Create a new ASMModel
ASMModel atlASMModel = null;
amh.createModelLoader().newModel("Marte2ATL", "file:/" + uri,
atlASMModel);
//Launch Parsing
atlASMModel = atlParser.parseToModel(input);
//Save to .ecore
atlASMModel.getModelLoader().save(atlASMModel, destination);
THIS CODE GAVE ME AN ATL MODEL IN AN ECORE FILE BUT I DON'T KNOW YET IF
AFTER THE HIGH ORDER TRANSFORMATION IT WILL BE RECOGNIZED AS A VALID ATL
TRANSFORMATION, I'M NOT THERE YET.
|
|
|
Powered by
FUDForum. Page generated in 0.05125 seconds