Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » python code generator
python code generator [message #1827806] Sun, 24 May 2020 16:47 Go to next message
John  S. is currently offline John S.Friend
Messages: 4
Registered: May 2020
Junior Member
Hello

Is there a possibility to generate python code from the sysml diagramms in papyrus.
Most important would be the generation to python code from an activity diagram.

Thank you for your help.

With kind regards
Re: python code generator [message #1827820 is a reply to message #1827806] Mon, 25 May 2020 06:26 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 273
Registered: May 2015
Location: Germany
Senior Member
Hi Andreas,

the only off the shelf code generator for Papyrus I am aware off is
https://wiki.eclipse.org/Papyrus_Software_Designer
But this generator (currently) only emits C++ and Java.

If you want to roll on your own generator, please have a look at
- https://www.eclipse.org/acceleo/
- https://www.eclipse.org/xtend/

/Carsten
Re: python code generator [message #1827821 is a reply to message #1827820] Mon, 25 May 2020 06:42 Go to previous messageGo to next message
John  S. is currently offline John S.Friend
Messages: 4
Registered: May 2020
Junior Member
Thank you for your information
Re: python code generator [message #1827932 is a reply to message #1827821] Wed, 27 May 2020 07:25 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 282
Registered: March 2011
Location: Paris Saclay, France
Senior Member
I´d recommend to use Xtend rather than Acceleo, You might also have a look at adding a new code generator (even if not up-to date).
Re: python code generator [message #1827936 is a reply to message #1827932] Wed, 27 May 2020 08:38 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 273
Registered: May 2015
Location: Germany
Senior Member
Both xtend and acceleo do the job.

The xtend programming language features more expression power and integrates with Java.

Acceleo for me has the huge advantage, it is also the base of GenDoc. Consequently I can use the programming language MOFM2T to generate code and to generate documents.

A hint: MOFM2T is an "isle". You have to use "bridges" to get in contact with the outside.

A second hint: MOFM2T is a purely functional programming language, side effects are impossible by language design. This is really helpful in some cases, but can also be hell in others.

/pica
Re: python code generator [message #1827939 is a reply to message #1827936] Wed, 27 May 2020 09:28 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6998
Registered: July 2009
Senior Member
Hi

In the past I have much preferred Xtend migrating all my Acceleo templates to Xtend, but now it is a difficult choice.

Acceleo is barely supported with long outstanding bugs that affect me.

Xtend is deprecated. Hopefully at least its M2T functionality will survive.

Otherwise it's JET, which does now have an Xtext-based editor, but it's from another age.

Regards

Ed Willink
Re: python code generator [message #1827940 is a reply to message #1827939] Wed, 27 May 2020 09:48 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 273
Registered: May 2015
Location: Germany
Senior Member
Hi Ed,
Hi Ansgar,

given that how would you rate

* directly interfacing to UML2 or even EMOF

* to base on the emitted XMI file (could by done with Python code, to close the loop to the originating post)

from your perspective.

/Carsten
Re: python code generator [message #1827942 is a reply to message #1827940] Wed, 27 May 2020 10:19 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6998
Registered: July 2009
Senior Member
Hi

Trivial structural UML to text is well-suited as an M2T 101. But fuller UML, especiallyOCL, requires a proper code generator, and after attempting OCL2Java in Acceleo, then Xtend, I ended up in pure Java; there is just too much strategical planning to do which requires an M2M. My next rewrite will probably be two step QVTr ending up in a sensible Java metamodel that should have its own built-in M2T.

This reminds me, using the http://www.eclipse.org/qvt/2018/TextModel metamodel it is now possible to use QVTo or QVTr as an M2T [1]. However the support is only sufficient to make it possible rather than pleasant.

Regards

Ed Willink


[1] http://www.eclipse.org/mmt/qvt/docs/OCL2018TextM2M/TextM2M.pdf
Previous Topic:Is relationship matrix broken in version 4.15?
Next Topic:How to export views and tables definitions from Eclipse HANA Studio to Papyrus?
Goto Forum:
  


Current Time: Wed Jan 27 17:52:00 GMT 2021

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

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

Back to the top