Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » how to import xmi into eclipse papyrus(how to import xmi into eclipse papyrus)
how to import xmi into eclipse papyrus [message #1854467] Fri, 19 August 2022 23:22 Go to next message
Arun M is currently offline Arun MFriend
Messages: 4
Registered: August 2022
Junior Member
Hello,
I'm looking for steps in eclipse modeling/papyrus that will help me import an existing yml diagram available as .xmi and then start enhancing the uml diagram in papyrus.
I tried installing eclipse modeling tool and papyrus on top and tried importing xmi and it did not highlight the xmi files for import (when i picked file system)

Specifically, I'm looking for diagrams created in genmymodel.com, exported as .xmi to be imported into papyrus and start using the diagram.

Any help would be great to know whether papyrus supports this and if yes what are the steps to do the same.

Thanks,
Arun


I could not add a sample snippet of the xmi file (top few lines for reference). Tried attaching instead..
Re: how to import xmi into eclipse papyrus [message #1854469 is a reply to message #1854467] Sat, 20 August 2022 07:07 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You need to understand that there are two sides to UML; the unified information model and the many disparate diagrams that provide useful views of that model.

Within Eclipse, the Eclipse UML2 project supports the UML information model with a tree editor and via an XMI file with a *.uml extension. The XMI closely corresponds to the UML 2.5 standard. It contains zero graphical/diagram information.

The Papyrus project extends the UML2 project by adding support for diagrams using XMI files with a *.notation extension (and a *.di extension overview). This XMI could be regarded as a bit of a prototype for the UMLDI specified for UML 2.5, but AFAIAA no tool currently supports the diagram interchange capability of UMLDI.

Therefore if you can export a UML 2.5 XMI information model from genmymodel.com, you should be able to open it with the UML Model Editor. (This is easier if you change the extension to *.uml). Once I remove the gratuitous leading blank line from your example, I can make some progress looking at your file but with much of the content elided as "..." it of course fails with mismatching XML tags. It looks as if the genmymodel.com is useable as-is; it certainly has encouraging Eclipse-isms within it.

Once you are able to open a UML information model in the UML Model editor, you can consider opening it in Papyrus and starting to draw diagrams, probably using the Initialize Diagram capability to seed your drawings with a few interesting classes that can be elaborated by DND.

Unless genmymodel.com has a Papyrus *.notation export capability you will have to redraw all diagrams.

Regards

Ed Willink
Re: how to import xmi into eclipse papyrus [message #1854548 is a reply to message #1854469] Wed, 24 August 2022 17:55 Go to previous messageGo to next message
Arun M is currently offline Arun MFriend
Messages: 4
Registered: August 2022
Junior Member
Hello Ed,
Thank you very much for your detailed response.
I did try exporting just the unified information model (without diagrams) from genmymodel and tried to rename the .xmi as .uml and tried to do the following steps
1. new model project in eclipse.
2. right click on the project and import, click on general /file system
3. was hoping the .uml would be highlighted in the folder, it did not highlight the .uml file.

Question: Are the above steps right to import the .uml or am I missing any critical steps to help with the import ?

Any thoughts to the above question would be great.

Thanks,
Arun
P.S:
Although the xmi refers to uml2 as schema references at the top, maybe there's more needed ..
As a parallel step, I will inquire to see whether I can get an explicit UML 2.5 XMI export from genmymodel, if possible to see whether it helps with eclipse papyrus.
And the "_" prefix in xml id tag is probably auto generated in genmymodel for every class/attribute.
And Looks like importing diagrams might be out of question at the moment based on your comments. I'd be happy to explore the classes created and its hierarchy if possible in a tree view within eclipse papyrus as a 1st step.

top of the .xmi off genmymodel which represents/states it supports uml2 in its schema refs.
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:com.genmymodel.ecoreonline.graphic="http://com.genmymodel.ecoreonline.graphic/2.0" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
<uml:Model xmi:id="_EoY5IOoUEeW5PZsPAEZoUA" name="ordercreation">
<xmi:Extension extender="http://www.eclipse.org/emf/2002/Ecore">
<eAnnotations xmi:id="_EoY5IOoUEeW5PZsPAEZoUA0" source="genmymodel">
Re: how to import xmi into eclipse papyrus [message #1854557 is a reply to message #1854548] Thu, 25 August 2022 11:48 Go to previous messageGo to next message
Patrick Tessier is currently offline Patrick TessierFriend
Messages: 341
Registered: July 2009
Location: Paris Saclay, France
Senior Member
Hi,
you might have forgotten to select the uml file in the step 2. You have to select the folder and then you have to select the files at the right of the UI.
The display of the file inside a project is independent of UML.
Patrick
Re: how to import xmi into eclipse papyrus [message #1854611 is a reply to message #1854557] Tue, 30 August 2022 00:01 Go to previous messageGo to next message
Arun M is currently offline Arun MFriend
Messages: 4
Registered: August 2022
Junior Member
Hello Patrick,
Thank you for the tip. As you had mentioned, I had to click the folder first before selecting the files //instead I was waiting for the files to be highlighted for me to pick the file in the same step.

Hello Ed,
Once I went past the import step, I was able to import the sample.xmi into eclipse, but I do get errors.
Here's a sample .xmi (exported out of www.genmymodel.com) for a whole project (that contains 2 class diagrams with a few classes in each 1 of the class diagrams ) which resulted with the following errors in a new (papyrus) project within eclipse modeling.
the .xmi contains the following 2 class diagrams
Class Diagram 1 Security : Security (and some sub classes) and a SecurityAssociation to represent a many to many relationship between Security and another SampleReference class.
Class Diagram 2 Core. : Currency, ExchangeRate.

I have attached the errors as an image for reference.
I have also attached the sampleUMLDomainModel.xmi for reference.

I am only looking into getting the 'classes' into eclipse at this point , not really the diagrams or representation since I'm unsure of the compatibility issues w.r.t required schema/etc.
Any thoughts/pointers would be great.

Thanks,
Arun
Error upon import :
org.xml.sax.SAXParseExceptionpublicId: http://www.omg.org/spec/UML/20131001/PrimitiveTypes.xmi; systemId: http://www.omg.org/spec/UML/20131001/PrimitiveTypes.xmi; lineNumber: 1; columnNumber: 50; White spaces are required between publicId and systemId.
at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)
Re: how to import xmi into eclipse papyrus [message #1854633 is a reply to message #1854611] Wed, 31 August 2022 09:41 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Pure OMG UML, uses a *.xmi extension and http://www.omg.org/spec/UML namespaces that change every release, which is not that rare.

Eclipse UML uses a *.uml extension and http://www.eclipse.org/uml2/5.0.0 namespaces that change every major release, which is rare.

The Eclipse UML2 attempts to support pure OMG UML but declines to provide wildcard namespaces, so you can only load precisely matching namespaces using a precise version converter. The OMG usage is very rare; non-Eclipse users attempting to import so the 'testing' is not as thorough as the main support. The diversity of strange third party inputs is also troublesome.

Your *.xml is a bit of a hybrid, using an Eclipse namespace for UML but an OMG namespace for the PrimitiveTypes. Loading therefore takes a path that successfully loads the outer XMI but fails loading the imported XMI that needs an apparently unregistered converter. Arguably a bug.

I can successfully load your file on the UML Model Editor if I change the extension to *.uml and edit all http://www.omg.org/spec/UML/20131001/PrimitiveTypes.xmi references to pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml.

Regards

Ed Willink
Re: how to import xmi into eclipse papyrus [message #1854658 is a reply to message #1854633] Thu, 01 September 2022 11:57 Go to previous messageGo to next message
Patrick Tessier is currently offline Patrick TessierFriend
Messages: 341
Registered: July 2009
Location: Paris Saclay, France
Senior Member
Thanks Ed,
I confirm the manipulation to load the file inside the UML Model Editor.
Patrick
Re: how to import xmi into eclipse papyrus [message #1855347 is a reply to message #1854633] Mon, 10 October 2022 02:10 Go to previous messageGo to next message
Arun M is currently offline Arun MFriend
Messages: 4
Registered: August 2022
Junior Member
Hello Ed,
Thank you very much for the response.
I am able to import the renamed sample.uml in eclipse modeling tool.
And I am able to see the classes within the project.
Questions:
How can I start using these imported classes in my eclipse project ?
1. For starters can I get some 'visual/diagram' representation, re-engineered based on the relationships?
If not, how would I go about using these classes to build out the domain model/entity relationship model using eclipse modeling?

2. And are there any ways to 'generate' code (ex., convert these imported classes using a code generator that can parse the uml or some simpler representation that eclipse provides say into POJO objects ?

Any links or samples would be great.

Thanks,
Arun
Re: how to import xmi into eclipse papyrus [message #1855360 is a reply to message #1855347] Mon, 10 October 2022 15:19 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Papyrus has an 'initialize Diagram' facility. I don't use it that often and get confused with a differently awkward Sirius facility that also doesn't work in normal perspectives, so I'm reluctant to offer guidance. Probably you use the Papyrus perspective and use a *.uml context menu option. Once you have a diagram you can create more diagrams and DND seed elements and then add surrounding elements until you have what you want. Then you can auto-arrange or more likely manual-arrange.

The EMF project provides an Ecore(+GenModel)2Java capability.
The UML2 project provides a UML2Ecore capability.
The OCL project adds a UML/Ecore2Java synthesis of embedded OCL.
The Papyrus project provides an overall integration. Follow the Papyrus tutorials.

Regards

Ed Willink
Re: how to import xmi into eclipse papyrus [message #1857194 is a reply to message #1855360] Mon, 23 January 2023 18:52 Go to previous messageGo to next message
Tom Parry is currently offline Tom ParryFriend
Messages: 3
Registered: January 2023
Junior Member
I am trying a similar import:
From MyEclipse UML2 there is the .uml file which I exported to xmi and tried to import to the standalone Papyrus.
The import works but is not recognized as a model.
Any help appreciated
Re: how to import xmi into eclipse papyrus [message #1857238 is a reply to message #1857194] Thu, 26 January 2023 12:50 Go to previous messageGo to next message
Vincent Lorenzo is currently offline Vincent LorenzoFriend
Messages: 247
Registered: June 2010
Location: Paris Saclay, France
Senior Member
Hello Tom,
As I understand, you did UML -> XML to import it into Papyrus ? The XMI step was not required... What do you mean by Quote:
is not recognized as a mode
?

--
Vincent
Re: how to import xmi into eclipse papyrus [message #1857239 is a reply to message #1857238] Thu, 26 January 2023 12:54 Go to previous messageGo to next message
Tom Parry is currently offline Tom ParryFriend
Messages: 3
Registered: January 2023
Junior Member
Sorry about that.
I did some more trial and error and found that all I have to do is import the uml file directly into papyrus . The docs and other stuff I read did not make it clear!

Now if I could import the diagrams that were made it would be even better because I have to recreate all diagrams.

Anyway I love the features in Papyrus.
Re: how to import xmi into eclipse papyrus [message #1857259 is a reply to message #1855360] Thu, 26 January 2023 21:42 Go to previous message
Tom Parry is currently offline Tom ParryFriend
Messages: 3
Registered: January 2023
Junior Member
Is it true that I cannot import a diagram made in MyEclipse uml2 (for example an interaction/sequence diagram). All I seem able to do is import the .uml file successfully and then recreate the class diagram. I was hoping to import the .uml and be able to create class and other diagrams. Looks like now I have to recreate interaction diagrams.
Previous Topic:How to find the <user guide> for drawing ALL kinds of UML Diagrams?
Next Topic:Lost Elements
Goto Forum:
  


Current Time: Thu Mar 28 17:26:14 GMT 2024

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

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

Back to the top