Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Java code generation from UML Behavioral diagrams(Can we generate java code form activity and sequence diagrams with papyrus?)
Java code generation from UML Behavioral diagrams [message #1784400] Tue, 27 March 2018 16:07 Go to next message
WINNER WINNER is currently offline WINNER WINNERFriend
Messages: 22
Registered: March 2018
Junior Member
Hello,

I would appreciate if you can answer me :

I have defined a class diagram with papyrus with the goal to automatically generate the Java corresponding code, for the structure it seems good and I find no problem, but i want that the objects interaction will be automatically generated from sequence diagrams, and the operations code of any class will be also generated from activity diagrams.

Is Papyrus offers this functionality?

With Best Regards.
Re: Java code generation from UML Behavioral diagrams [message #1784458 is a reply to message #1784400] Wed, 28 March 2018 08:21 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Hi,

Papyrus SW designer does not offer Java code generation for behavior diagrams. It offers C++ code generation for state-machines diagrams and will soon offer it for Java as well. However, it does not offer code generation from sequence diagrams.

Ansgar
Re: Java code generation from UML Behavioral diagrams [message #1784467 is a reply to message #1784458] Wed, 28 March 2018 09:59 Go to previous messageGo to next message
WINNER WINNER is currently offline WINNER WINNERFriend
Messages: 22
Registered: March 2018
Junior Member
Thank you very much for your answer, then if you have any idea to generate the java code from these diagrams can i get the EMF corresponding meta-model and the Ecore model to define an ATL transformation?

Re: Java code generation from UML Behavioral diagrams [message #1785256 is a reply to message #1784467] Wed, 11 April 2018 15:27 Go to previous message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Hi,

well, a UML model is an EMF model (there is an UML.ecore in the org.eclipse.uml2.uml model). So, I don't see a problem to write ATL transformations, but you would have to rewrite a Java generator from scratch. Therefore, I would recommend to look into the transformation approach in Papyrus SW designer. The idea is that the code generators support the basic structural UML entities and opaque expressions. Additional functionality, such as state-machine generation is provided by model 2 model transformations (i.e. UML to UML) that are part of a configurable/extensible transformation chain. Doing so, the existing Java code generator is reused. In this case, the required transformation would not be very different from the one we have for C++ .

Hope that helps

Ansgar
Previous Topic:Layer function and StateMachines
Next Topic:Usage relationship on sysML palette for IBD?
Goto Forum:
  


Current Time: Tue Apr 16 14:11:13 GMT 2024

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

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

Back to the top