i have problems with QuickStart tutorial of Acceleo 3.2. i can't seem to generate any code (see topic)

[module generateStuff('http://www.eclipse.org/emf/2002/Ecore', 'http://www.eclipse.org>/ocl/1.1.0/UML', 'http://www.eclipse.org/uml2/3.0.0/UML')]

[template public generateElement(aEClass : EClass)] hello [aEClass.name/] [/template]

i would also like to get c# and some sql code out of acceleo. are there any plugins migrated from acceleo 2 yet?

1

There are 1 best solutions below

0
On

First of all, the URI of the OCL metamodel is not valid, it should be "'http://www.eclipse.org/ocl/1.1.0/UML". Then, what kind of input model are you using? If you are using an UML model, you can remove the URI of Ecore and OCL and you need to change your module to something like this:

[module generateStuff('http://www.eclipse.org/uml2/3.0.0/UML')]

[template public generateElement(aClass : Class)]
[comment @main /]
[file('myFile.txt', false, 'UTF-8')] hello [aClass.name/] [/file]
[/template]

EClass is a concept of Ecore and since you have also the UML metamodel register I believe that you want to generate C# and SQL from an UML model so this would generate something. If you want you can have a look at the open source UML to Java generator in order to see how you can create your generator. You can also have a look at the UML to Java example embedded in Acceleo (File -> New -> Example -> Acceleo -> UML to Java). You may need to install the UML plugin for Eclipse if you want to manipulate UML models (Help -> Install new software -> (select the update site starting with http://download.eclipse.org/releases/) -> Modeling -> UML2 SDK).

Regards,

Stephane Begaudeau

Disclaimer: I am the leader of the Acceleo project.