Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate java (Problems of Acceleo getting start.)
The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate java [message #1797083] Thu, 25 October 2018 03:31 Go to next message
zhang xh is currently offline zhang xhFriend
Messages: 9
Registered: October 2018
Junior Member
Hello, I spend several days to follow the Getting Started guidance in the wiki to generate java code from uml. I found some problems during the steps and failed to generate code. This is the link of the guidance I followed: https://wiki.eclipse.org/Acceleo/Getting_Started.
The first question is: when I Right-click on the Acceleo module file (that is, the generate.mtl file) and select Run As > Launch Acceleo Application. I can't find the uml model imformation, and also with the Target.

The second question is the problem shown in the acceleo when I finished all the step in the getting start guidance.
1). Description Resource Path Location Type
Cannot find operation (generate()) for the type (Class) uml2beans.mtl /org.eclipse.acceleo.module.sample/src line 9 Acceleo Problem
2).Description Resource Path Location Type
Module org::eclipse::acceleo::module::sample::files::generate not found. uml2beans.mtl /org.eclipse.acceleo.module.sample/src line 4 Acceleo Problem
3)Description Resource Path Location Type
The method Uml2beans(EObject, File, List<capture#4-of ? extends Object>) is undefined for the type GenerateAll GenerateAll.java /org.eclipse.acceleo.module.sample.ui/src/org/eclipse/acceleo/module/sample/ui/common line 89 Java Problem

In case you can recurrent the problems, I'll show you the version of eclipse and acceleo I use.
Eclipse IDE: 2018-9(4.9.0)
Acceleo:3.7.6201810050
Could you show me how to operate correctly to avoid these problems or is there any problems in my installation?
Thankyou!
Re: The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate j [message #1797307 is a reply to message #1797083] Mon, 29 October 2018 17:05 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6437
Registered: July 2009
Senior Member
Hi

The first question suggests that you neglected to install Eclipse UML2 (aka MDT/UML), which the Getting Started Introduction takes for granted, since the first thing you do is visualize the UML model in a tree editor. Are you able to get a display similar to that in the Introduction?

If you have no UML, the second question is redundant.

I suggest you review other threads concerned with Acceleo and UML since at a quick glance, the vintage Wiki tutorial does not match my recollection of the correct path to success.

In particular I see no instruction on the necessary manual edit to Generate.java to invoke UMLResourcesUtil.init().

Regards

Ed Willink

Re: The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate j [message #1797325 is a reply to message #1797307] Tue, 30 October 2018 01:57 Go to previous messageGo to next message
zhang xh is currently offline zhang xhFriend
Messages: 9
Registered: October 2018
Junior Member
Thank you very much for your suggestion!
I installed the UML2 and tried again. There still some problems exists since no code is generated. Could you provide some success guidance or examples for me!
Thank you again for your help!
Re: The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate j [message #1797353 is a reply to message #1797325] Tue, 30 October 2018 08:32 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6437
Registered: July 2009
Senior Member
Hi

"some problems exist" - vague hard to help.

"no code is generated" - vague, what is missing that you expected....

Since I cannot see your workspace I can only guess at what you did 'wrong'. Providing a zipped copy of your project can be very helpful. See https://wiki.eclipse.org/OCL/ForumNetiquette

Regards

Ed Willink
Re: The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate j [message #1797479 is a reply to message #1797353] Wed, 31 October 2018 13:12 Go to previous messageGo to next message
zhang xh is currently offline zhang xhFriend
Messages: 9
Registered: October 2018
Junior Member
Hi, I uploaded my test project and also with the configuration. The problems are the same as I proposed firstly. Could you try my project and if you successes, please let me know how to do it. Thank you!
  • Attachment: test sample.rar
    (Size: 16.67KB, Downloaded 27 times)
  • Attachment: 1.PNG
    (Size: 165.42KB, Downloaded 79 times)
Re: The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate j [message #1797486 is a reply to message #1797479] Wed, 31 October 2018 14:48 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6437
Registered: July 2009
Senior Member
Hi

I found an open Bugzilla [1] promising in 2013 to update the tutorial. I have added some comments on some problems I encountered to the Bugzilla.

Sorry, this has just reminded me of many pains that persuaded me to migrate from Acceleo to Xtend.

You might be interested in my recent paper [2] showing how an M2M such as QVTo or ATL can be used for M2T.

If you persist with Acceleo, I recommend that you install Acceleo from its download ZIP [3] so that you get everything, then elaborate from the UML2Java example provided as a New->Example.

I don't know how/if the UML2Java example works since it predates the separation of the PrimitiveTypes Package for UML 2.5. The initialization therefore looks very suspect. It should call UmlResourcesUtil.int().

Regards

Ed Willink

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=412512

[2] http://www.eclipse.org/mmt/qvt/docs/OCL2018TextM2M/TextM2M.pdf

[3] http://www.eclipse.org/downloads/download.php?file=/acceleo/downloads/drops/3.7.6/R201810050612/acceleo-update-3.7.6.zip&protocol=http
Re: The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate j [message #1797577 is a reply to message #1797486] Fri, 02 November 2018 08:07 Go to previous messageGo to next message
zhang xh is currently offline zhang xhFriend
Messages: 9
Registered: October 2018
Junior Member
Thank you for your suggestion!
I see your comments and read your paper. If the M2M can also convent the model to text ,can you show me the example and the tutorial?
Additionally, I update the Acceleo, andt try the uml2java sample. When I run the uml2java.mtl,the error log shows some errors as seen in the attachment.
Is there anything I should do which is not shown in the tutorial?
  • Attachment: 1.PNG
    (Size: 13.51KB, Downloaded 29 times)
Re: The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate j [message #1797578 is a reply to message #1797577] Fri, 02 November 2018 08:58 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6437
Registered: July 2009
Senior Member
Hi

The research work leading to the M2M for M2T is described in https://bugs.eclipse.org/bugs/show_bug.cgi?id=528050 The four QVTo M2T's can be found in branch ewillink/528050 of https://git.eclipse.org/r/ocl/org.eclipse.ocl

e.g. http://git.eclipse.org/c/ocl/org.eclipse.ocl.git/tree/examples/org.eclipse.ocl.examples.ecore2xtext/src/org/eclipse/ocl/examples/ecore2xtext/Ecore2Bison.qvto?h=ewillink/528050

As a supporter of OMG specifications, I do my best to help but it is over 5 years since I migrated all my M2Ts away from Acceleo. There are limits to my enthusiasm in helping solve significant ergonomic problems that appear to get steadily worse with time. Whenever I install Acceleo in my workspace to try to help, I usually get a number of additional problems to contend with. It is costing me too much time.

Sadly the OMG MOFM2T specification that underlies Acceleo appears pretty dead. No company has expressed interest in establishing the RTF that can address issues in the now 10 year old 1.0 specification.

Equally sadly the Acceleo support is poor; it is now over six months since any Acceleo committer has responded on this forum. https://projects.eclipse.org/projects/modeling.m2t.acceleo shows about 2 commits per month. Minor bug fixing is occurring. The project is not dead, but the usability challenges remain unaddressed.

Regards

Ed WIllink
Re: The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate j [message #1797743 is a reply to message #1797578] Tue, 06 November 2018 03:22 Go to previous messageGo to next message
zhang xh is currently offline zhang xhFriend
Messages: 9
Registered: October 2018
Junior Member
Hello! I am interesting in how can M2M achieve M2T. Could you show me the detail of the transform, and what tool is used? Thank you!
Re: The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate j [message #1797749 is a reply to message #1797743] Tue, 06 November 2018 06:19 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6437
Registered: July 2009
Senior Member
Hi

Did you actually read [2] http://www.eclipse.org/mmt/qvt/docs/OCL2018TextM2M/TextM2M.pdf

Regards

Ed Willink
Re: The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate j [message #1797750 is a reply to message #1797749] Tue, 06 November 2018 06:32 Go to previous messageGo to next message
zhang xh is currently offline zhang xhFriend
Messages: 9
Registered: October 2018
Junior Member
Hello, I did't say it clearly.
I mean could you provide a tutorial to guide me to do the transform? And which tool you think is better if I want transform a EMF model to text(java, C), the ATL or others?
Thank you!
Re: The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate j [message #1797757 is a reply to message #1797750] Tue, 06 November 2018 07:57 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6437
Registered: July 2009
Senior Member
Hi

If you have funding, I could write a tutorial for you ...

For small problems, the tool that you are most familiar with is often the most appropriate.

The ability to use an M2M for M2T is bleeding edge. If you don't like bleeding then don't use it.

Regards

Ed Willink
Re: The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate j [message #1801387 is a reply to message #1797757] Fri, 18 January 2019 05:28 Go to previous messageGo to next message
zhang xh is currently offline zhang xhFriend
Messages: 9
Registered: October 2018
Junior Member
Hi , I'm back again. I have generated some simple code from EMF model, but I find I can't specify some of the model element to be used to generate code and others not in the defined template. Is there any rules about how to do this in Acceleo template? Thank you!
Re: The problems occurs when I follow the Acceleo Getting Started guidance in the wiki to generate j [message #1801389 is a reply to message #1801387] Fri, 18 January 2019 06:22 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6437
Registered: July 2009
Senior Member
Hi

Do not re-use old topics for new issues; it totally undermines the forum as a reference.

Yournew question makes no sense. Acceleo does not generate code; it executes a transformation that may result in what you choose to call code. The 'problem' presumably lies in your transformation and so in your programming. Conditionalisation is a very well known programming technique. Acceleo has an [if .....] construct.

Regards

Ed Willink
Previous Topic:[Acceleo] Dependency on a Reusable Base Generator not Working
Next Topic:[Acceleo] Generator works with Papyrus, but fails with MagicDraw
Goto Forum:
  


Current Time: Sun Aug 18 23:28:02 GMT 2019

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

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

Back to the top