Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Papyrus UML to Java using Acceleo
Papyrus UML to Java using Acceleo [message #1016638] Thu, 07 March 2013 08:42 Go to next message
roshni rajagopal is currently offline 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 17:48 Go to previous message
André Ribeiro is currently offline André Ribeiro
Messages: 48
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
Previous Topic:Sharing JET2 templates between transformations
Next Topic:[ACCELEO] Dynamic templates generator deployment
Goto Forum:
  


Current Time: Tue Oct 21 03:56:49 GMT 2014

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

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