Converting a UML class diagram created using Papyrus into an .ecore file

蓝咒 提交于 2019-12-06 01:39:25

I happened to bump into this problem very recently and found an easy solution so thought I would share.

In addition to Papyrus, I have the Obeo UML Designer 6.1 plugin installed.

1) UML Designer adds a concept of a "Modeling Project". Create one from the File->New submenu.

2) Find the Papyrus model you want to convert to ECore. Under its root node you will generally see two children labeled "notation" and "uml". The node labeled "uml" corresponds to a file called "model.uml". Click it and copy the file path to the clipboard.

3) Return to your Modeling Project. Paste your clipboard into it, and you should see "model .uml" appear. Open it.

4) Open the "root resource node" and select its single child, which will be referred to below as the "root model node". -- This should be a UML model object representing the root of the model you are porting. -- If you see something else, check whether you failed to overwrite a pre-existing file or copied the wrong model source .

5) Make sure you are on the Modeling perspective and see the "UML Editor" menu. With the root model node still highlighted, navigate to "Convert To" -> "Ecore Model..."

6) Complete the wizard. Correct any errors and reepat if necessary.

The Obeo Designer is an open source project available on GitHub, so I imagine its possible to pick apart the Manifest file to identify the menu contribution for "To Ecore..." and then locate the actual source code through GitHub.

Papyrus is an UML Editor which requires other plugins. You need to use another plugin such as accelero in order to generate code but to be honest it seems that since Eclipse 3.5 this plugin is not really working with the latest releases. The best would be to swap to Topcased which is modeling development environment including code generation. The only problem is that Topcased has been abandoned in order to be merged inside Papurus MDT so it is better not to invest in this tool today and stick to Papyrus MDT.

Creating ecore model from papyrus is impossible because it works with a GMF model and not directly from an Ecore model. GMF being also abandoned since Eclipse 3.5 I don't know what to say ... Good luck,

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!