Status of code generation in Papyrus? [message #1030018] |
Sat, 30 March 2013 14:54 |
Jay Billings Messages: 54 Registered: July 2011 |
Member |
|
|
Everyone,
I have imported a UML model from IBM Rational Software Architect into Papyrus and I would like to generate code from it. I found some tutorials on the old Papyrus site showing videos of the code generator (run via run configurations), but it appears to be unavailable in Eclipse Juno SR2. It is listed, but not discussed in the user's guide at:
http://wiki.eclipse.org/Papyrus_User_Guide#C.2FC.2B.2B_Code_Generation
Could someone please tell me what the status is of this capability? It is available now, planned for some future release or unplanned?
Thanks!
Jay
Jay Jay Billings
Oak Ridge National Laboratory
Twitter: @jayjaybillings
|
|
|
Re: Status of code generation in Papyrus? [message #1030124 is a reply to message #1030018] |
Sat, 30 March 2013 18:27 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi
It depends what you mean by code generation.
If you just want class structure (Package, Class, Property, Operation) ,
that has been available for a long time via the UML to Ecore converter.
EMF supports generation of Java from the Ecore model.
If you also want OCL elaboration of Class invariants and Operation
bodies, then you will be pleased to know that a stupid bug has been
fixed for Kepler so that the OCL is correctly expressed as Ecore
delegates for interpretation at run-time. You may be even more pleased
that the OCL to Java code generator is fully integrated so that if you
genmodel you get compiled Java for the OCL.
If you also want more advanced UML facilities such as State Machines,
you need to look for additional tooling. I suspect that Acceleo may have
some examples.
You may note that none of the above is a Papyrus facility; they are more
general.
Regards
Ed Willink
On 30/03/2013 14:54, Jay Billings wrote:
> Everyone,
>
> I have imported a UML model from IBM Rational Software Architect into
> Papyrus and I would like to generate code from it. I found some
> tutorials on the old Papyrus site showing videos of the code generator
> (run via run configurations), but it appears to be unavailable in
> Eclipse Juno SR2. It is listed, but not discussed in the user's guide at:
>
> http://wiki.eclipse.org/Papyrus_User_Guide#C.2FC.2B.2B_Code_Generation
>
> Could someone please tell me what the status is of this capability? It
> is available now, planned for some future release or unplanned?
>
> Thanks!
>
> Jay
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Status of code generation in Papyrus? [message #1066935 is a reply to message #1052945] |
Fri, 05 July 2013 08:15 |
Stefan Eidelloth Messages: 29 Registered: September 2011 |
Junior Member |
|
|
Goood Guy wrote on Wed, 01 May 2013 10:13Hi
...
* choose "file > new > other > EMF Project"
...
run the code generation from the .genmodel (more details in EMF forum)
What eclipse version and update sites do you recommend to do so?
I am a newbe and tried to install EMF-Core on Kepler with an update site
but it did not work.
I am looking for a round trip solution for UML modeling of java in eclipse.
I like Green UML (it is the most intuitive I could find until now) but it
is out of date and has some other issues, too. The java code generation feature
for papyrus looks very promising in the old documentation. Does somebody
know a tutorial for roundtrip UML modeling of java with papyrus (and additional
eclipse plugins)?
If this is not possible, do you know a free alternative that is up to date?
I tried the free UML editors from this overview and I am kind of stuck now:
http://wiki.eclipse.org/MDT-UML2-Tool-Compatibility
Sunny regards
[Updated on: Fri, 05 July 2013 08:18] Report message to a moderator
|
|
|
|
Re: Status of code generation in Papyrus? [message #1067046 is a reply to message #1066954] |
Fri, 05 July 2013 15:13 |
Stefan Eidelloth Messages: 29 Registered: September 2011 |
Junior Member |
|
|
Ok, thanks a lot.
Here is a description of how far I got now
(example files are attached as zipped project):
1. Create Java Project
2. Create Papyrus UML Model: file > new > other > Papyrus > Papyrus Model
* choose UML as diagram language
* choose the option "UML Class Diagram" to create a class diagram
* open model.di and add some classes to the diagram with the tools in "Palette"
3. Save model.di (The following step did not work for me without saving.)
4. Create Ecore Generator Model from Papyrus UML Model
* right click on model.di and select
* "new > other > Eclipse Modeling Framework > EMF Generator Model"
* Select "UML model"
* Select the model.uml file that was created by papyrus from your workspace
5. Generate Java Code
+ Open model.genmodel and select the root node
+ Right click and select "Generate Model Code"
=> some code is generated in the src folder
----------------------------
So far, so good. Some questions are left:
- If I make changes to the papyrus file model.di, how can I update the ecore model?
+ Do I have to manually create it new or
+ can I do something like "update ecore from uml source" or
+ is there something like an "auto update" - feature?
- If I change the generated code in the src-folder, how do I automatically update the uml model and the ecore model to include new classes?
------------
Edit:
I found some links about automation with ant or maven:
Ant:
http://cubussapiens.hu/2010/12/generating-java-code-from-emf-models-automatically
http://www.eclipse.org/forums/index.php?t=msg&th=129660/
Maven:
http://www.eclipse.org/forums/index.php?t=msg&th=134237
http://mapasuta.sourceforge.net/maven/site/maven-emfgen-plugin/genmodel-mojo.html
Quote:The previous plugins should be available from Papyrus adititional
features soon.
=> Should I try to go on with ant/maven our with the tool from Cedric Dumoulin mentioned above (his update site does not seem to work)? Any further alternatives?
[Updated on: Sat, 06 July 2013 08:13] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10229 seconds