Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Load 2 differents input models an Acceleo template(I have been trying to load two models conforming to the metamodels taken at the input of my m2t transformation module, but to no avail)
Load 2 differents input models an Acceleo template [message #1794013] Wed, 22 August 2018 12:44 Go to next message
Gerard Nzebop is currently offline Gerard NzebopFriend
Messages: 3
Registered: August 2018
Junior Member
This question is not new because I saw at least two previous posts related to it. But following the thread of the discussion, none has brought a solution.
There is:
- https://www.eclipse.org/forums/index.php/t/1092427/


But it's really surprising that a question like this does not find a precise answer from the Acceleo community, or through their tutorials ...

To accept something like the following

[comment encoding = UTF-8 /]
[module generate('http:///org/eclipse/some/model/MetaModelA.ecore','http://www.eclipse.org/some/model/MetaModelB.ecore')/]

[import org::eclipse::acceleo::module::sample::files::processJavaFile /]

[template public generate(aProcess : Process, aDefinition : Definition)]
[comment @main /]
    Process Name : [aProcess.name/]
    Def Location : [aDefinition.location/]  
[/template]



it is really beautiful, but after, do not offer tools to read two instances of these models during the execution, it's really a failure ...

Since then, I try to modify the Java code generated but I have not succeded to fix this issue.
I think that the designers of Acceleo must provide an answer, because it's really absurd.

Example: When performing an M2M transformation with ATL, the execution of the corresponding configuration gives a priori fields to indicate the access paths to the models.

Why Acceleo cannot do so much?
It's really confusing to say in their literature that we can take several models in input, and it is when you have advanced a lot that you realize that

  1. with one model it works perfectly,
  2. but with two, is a real headache.


Excuse me for presenting my problem that way, ...

Please I need help.
I don't know if there is someone who has REALLY SOLVED THIS PROBLEM and who can help me, so that I can move forward.


Thank you VM!
Re: Load 2 differents input models an Acceleo template [message #1794236 is a reply to message #1794013] Mon, 27 August 2018 20:18 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Acceleo can be a bit limiting, but it's root Java code has the flexibility/necessity to support a custom invocation.

If you prefer an M2M such as ATL, [1] shows how you can use your favourite Eclipse M2M as an M2T.

Regards

Ed Willink

[1] https://www.eclipse.org/mmt/qvt/docs/OCL2018TextM2M/TextM2M.pdf
Re: Load 2 differents input models in an Acceleo template [message #1794323 is a reply to message #1794236] Wed, 29 August 2018 01:46 Go to previous messageGo to next message
Gerard Nzebop is currently offline Gerard NzebopFriend
Messages: 3
Registered: August 2018
Junior Member
I thank you for this alternative solution.

But in my case, this solution is not effective. I realize a M2T transformation to implement a code generation process: the text corresponds to a code in a target language which is Arduino (an .ino file).
i.e. :
tr: (aM1: Model1, aM2: Model2) --> an .ino file
In your approach, the format of the output file is an xmi in which you have to navigate to find the output text (result.text), copy it and save in a file; that is very annoying !

Until OMG standards adopt it and develop a tool-based TextM2M custom process, my thirst remains.
Re: Load 2 differents input models in an Acceleo template [message #1794330 is a reply to message #1794323] Wed, 29 August 2018 05:23 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The magic of EMF Resources is for the most part hard-wired to the extension, so if your output extension is "ino" you will get perhaps an INOResource and if that does not exist an XMIResource. In order to get text from an M2M you must specify "textmodel" as the output extension and perhaps then copy/rename from "textmodel" to "ino".

Regards

Ed Willink
Re: Load 2 differents input models in an Acceleo template [message #1794542 is a reply to message #1794330] Sat, 01 September 2018 17:59 Go to previous message
Gerard Nzebop is currently offline Gerard NzebopFriend
Messages: 3
Registered: August 2018
Junior Member
Hi

Thanks, but I found this solution not appropriate.

Please, do you have any idea on how to solve this issue with Acceleo step-by-step ?

What are elements that need exactly to be modified on the java code generated ?

Thanks
Previous Topic:[Acceleo] [Luna] Launching acceleo problem
Next Topic:Papyrus UML to Java using Acceleo
Goto Forum:
  


Current Time: Thu Apr 18 10:02:45 GMT 2024

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

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

Back to the top