| Papyrus UML to Java using Acceleo [message #1016638] |
Thu, 07 March 2013 03:42  |
roshni rajagopal Messages: 9 Registered: February 2013 |
Junior Member |
|
|
I want to convert the papyrus UML model to java using Acceleo.
I followed the steps at http://wiki.eclipse.org/Acceleo/Getting_Started
, but get this error when i run generate.mtl "An internal error occurred during: "Launching Generate".
Could not find public template generateElement in module generate."
Here is the template file I use. What could be the issue?
[comment encoding = UTF-8 /]
[module generate('http://www.eclipse.org/uml2/4.0.0/UML')/]
[template public generate(aClass : Class)]
[file (aClass.name.concat('.java'), false)]
public class [aClass.name.toUpperFirst()/] {
[for (p: Property | aClass.attribute) separator('\n')]
private [p.type.name/] [p.name/];
[/for]
[for (p: Property | aClass.attribute) separator('\n')]
public [p.type.name/] get[p.name.toUpperFirst()/]() {
return this.[p.name/];
}
[/for]
[for (o: Operation | aClass.ownedOperation) separator('\n')]
public [o.type.name/] [o.name/]() {
// TODO should be implemented
}
[/for]
}
[/file]
[/template]
|
|
|
| Re: Papyrus UML to Java using Acceleo [message #1017131 is a reply to message #1016638] |
Sat, 09 March 2013 12:48  |
André Ribeiro Messages: 43 Registered: January 2013 |
Member |
|
|
Hi Roshni,
It seems you forgot to add the @main annotation.
[comment encoding = UTF-8 /]
[module generate('http://www.eclipse.org/uml2/4.0.0/UML')/]
[template public generate(aClass : Class)]
[comment @main /]
[file (aClass.name.concat('.java'), false)]
...
André Ribeiro
IST Lisbon
Portugal
|
|
|
Powered by
FUDForum. Page generated in 0.01519 seconds