Need some help to understand the process Papyrus => Acceleo => java code [message #654937] |
Thu, 17 February 2011 11:49  |
Eclipse User |
|
|
|
Dear community,
Since yesterday I try to understand how to generate java code from a payrus UML model.
Well, I've downloaded the last Eclipse Modeling tools version.
I've successfully installed the acceleo and papyrus modules.
But now, for me it is the blank page.
After reading some (very old) documentation and reading some forums, I don't know how to do.
I can easily create an class diagram with Papyrus but after, nothing.
May I first create an java project ? (which is what I want) and after add a papyrus model ? and how to plug Acceleo ? And what mean the "Create Acceleo UI lancher project" ? this is for me ? to do what ?
Sorry but after reading various similar questions without answer I think that I'm not the only one who need some help.
Best regards,
Norbie
|
|
|
Re: Need some help to understand the process Papyrus => Acceleo => java code [message #654985 is a reply to message #654937] |
Thu, 17 February 2011 16:27   |
Eclipse User |
|
|
|
Without putting too much thought into this response, I would suggest you look at some of the Acceleo tutorials. UPDATE: I just downloaded Papyrus and verified that this works even without changing the default .mtl file.
Instead of creating your own meta-model (skip over this in the tutorials), and instead of instantiating a model from a custom meta-model, you'll use the UML meta-model and the model file you created from Papyrus.
This will come into play during the part where you create a new acceleo project (skip the part where you spawn a new Eclipse session). From Eclipse, Go to File, new, Acceleo Project, next, for the meta-model, click browse and use the UML2 one (I think it should be http://www.eclipse.org/uml2/3.0.0/UML).
For the generate for type field, try creating a generator for "class" type, and see the tutorials for examples on how to create generators.
When you're ready to test your generator, you'll right-click on the "main.mtl" file like you created in the tutorials, and select the papyrus model (the .uml file) you created along with the other parameters mentioned in the tutorials.
Jeff
[Updated on: Thu, 17 February 2011 17:20] by Moderator
|
|
|
|
|
|
Re: Need some help to understand the process Papyrus => Acceleo => java code [message #655158 is a reply to message #654937] |
Fri, 18 February 2011 09:09  |
Eclipse User |
|
|
|
Hi Norbie,
1- Check your run configuration to see if you are generating in the same folder and if you correctly take into account your uml model (Run -> Run Configurations)
2- In the previous version of the Papyrus modeler, I am pretty sure that the generator was based on Acceleo 2 which has a big UML to Java generator created by the CEA, Obeo and other contributors (If I remember correctly). This generator has not been migrated yet in Acceleo 3 because we are currently focusing on the improvement of Acceleo 3 with new features etc.
3- There are two projects :
- "org.eclipse.acceleo.module.example.uml2java.helios" is the Acceleo generator
- "org.eclipse.acceleo.module.example.uml2java.helios.ui" is a eclipse plugin which will create a menu in Eclipse to let you have your generator in your Eclipse without even seeing the generator. It will create a right click action on your *.uml model and you would just have to do right click -> acceleo -> Generate UML to Java.
Stephane Begaudeau, Obeo
--
Twitter: @sbegaudeau
Acceleo wiki: http://wiki.eclipse.org/Acceleo
Blogs: http://stephanebegaudeau.tumblr.com & http://sbegaudeau.tumblr.com
|
|
|
Powered by
FUDForum. Page generated in 0.04983 seconds