Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Importing a model from a model
Importing a model from a model [message #1804059] Sun, 17 March 2019 03:02 Go to next message
Marshall Charron is currently offline Marshall CharronFriend
Messages: 72
Registered: August 2018
Member
Hi everyone,

I have an EMF model A. Inside A I import a model B. The import is done using an attribute called path which a string containing the relative path to model B. I would like to use ATL to make a transformation of B with the information in A. The output models should be B models.

I am stuck with including model B in my ATL file. I use to retrieve the model programmatically using JAVA. But in ATL I don't know how to do that.

Do you think that this is achievable with ATL ?
Re: Importing a model from a model [message #1804230 is a reply to message #1804059] Wed, 20 March 2019 20:10 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 581
Registered: September 2012
Location: Belgium
Senior Member

ATL as a language isn't meant to deal with model loading and saving; that's the domain of EMF. EMF can resolve references between models automatically, with the only limitation that you have to refer to an element within the other model, instead of the model itself. I've attached an example, where models conforming to metamodel A can refer to models conforming to metamodel B. It works by using regular EReferences between EClasses of different metamodels.

Alternatively, you could generate an executable version of model A, that will run the transformation on the referenced B models. This executable version could be an Ant script, using the ATL or EMFTVM tasks, for example.


Cheers,
Dennis
Re: Importing a model from a model [message #1804248 is a reply to message #1804230] Thu, 21 March 2019 08:25 Go to previous message
Marshall Charron is currently offline Marshall CharronFriend
Messages: 72
Registered: August 2018
Member
Thank you for your reply.

Well I am not sure what do you mean by an executable model. Could you please give me an example.

Thanks a lot
Previous Topic:Using custom Java Methods with emftvm
Next Topic:open ATL editor programmatically
Goto Forum:
  


Current Time: Sat Nov 11 08:20:00 GMT 2023

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

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

Back to the top