Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » AM3 » [AM3] Is there any doc on AM3?
[AM3] Is there any doc on AM3? [message #374305] Wed, 04 March 2009 14:34 Go to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
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 #374307 is a reply to message #374305] Thu, 12 March 2009 17:28 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
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 #374308 is a reply to message #374307] Fri, 13 March 2009 08:25 Go to previous message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
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 17:28 Go to previous message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
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 08:25 Go to previous message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
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.
Previous Topic:[AM3] [ATL] [TCS] "atl" language absent in LanguageRegistry
Next Topic:New documentations & publications about the AM3 Megamodeling prototype are now available from th
Goto Forum:
  


Current Time: Fri Apr 19 22:30:01 GMT 2024

Powered by FUDForum. Page generated in 0.02939 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top