| [Acceleo] Doesn't transform classes that are inside packages [message #1034285]
||Fri, 05 April 2013 04:43
| Javier García
Registered: April 2013
I'm facing a problem with Acceleo 3, I'll try to explain in detail.
I generate a UML file from Java code using MoDisco, then with Papyrus I set a profile on that model, then I transform it with ATL to another UML model and finally I transform it to Java code again using Acceleo.
The classes are inside a package, which is inside another package, which is inside a model, which is inside another model.
Now the problem is that none of these classes are getting generated, so I tried taking the classes out of the package and the generation works perfectly, so I think it's not a problem with the template or the .mtl file and it's not either a problem with the classes, it seems like Acceleo has a problem accessing the classes inside these packages, does anyone know how could I fix this?
The idea is to use this on many different models, so I can' be editing all models to take the classes out of their packages.
Thanks in advance,
|Re: [Acceleo] Doesn't transform classes that are inside packages [message #1036319 is a reply to message #1034285]
||Mon, 08 April 2013 04:21
| Stephane Begaudeau
Registered: April 2010
Location: Nantes (France)
Acceleo can generate code from UML classes nested inside packages. What is the code that you are using in your template to navigate inside of model? Something like this would work:
[template public aTemplate(aModel: Model)]
[template private generateFile(aClass: Class)]
[file (aClass.name + '.java', false, 'UTF-8)]
".eAllContents(Type)" is here used to navigate recursively on all the children of my model object to select all the children with the type "Class".
If you are looking for an UML to Java generator, I have realized one for UML2 v3.x.x and UML2 v4.x.x, it is open source and available on Github (branch R1_0_maintenance for UML2 v3 (UML to Java 1.0.x) and branch master for UML2 v4 (UML to Java 2.0.x)). This generator comes with its dedicated launch configuration to specify the options of the generation and it also generates Eclipse project for each UML components located in your model. The version 2.0.0 will be released in a couple of days for the new release of UML Designer.
Stephane Begaudeau, Obeo
Blog: http://stephanebegaudeau.tumblr.com | Eclipse Java Development Tools Tips and Tricks
[Updated on: Mon, 08 April 2013 04:23]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01516 seconds