How to import any UML/XMI files to StarUML?
Asked Answered
D

1

6

I am trying to import a UML Diagram (of a C++ project) I designed in a program called Visual Paradigm.

This program allows me to save the UML diagram in various formats

Image)

and when I choose the XMI format (supported by StarUML through an extension ) it allows me to pick the XMI version to save the file

Image

The problem comes when I try to import the file in StarUml: when I try to load an XMI file (I tried every version) that cames from V.P. it says "Failed to load the file";

Image

On the other hand, if I save the diagram into UML2 format and then I try to open it, StarUML just does nothing.

Do You have any suggestions to work this problem out?

Here is a zip archive with another simpler project containing source code and XMI files (different versions) generated by Visual Paradigm: Project.rar

Delftware answered 16/2, 2020 at 16:17 Comment(2)
can you try with a simple project containing for instance just one class, allowing you to give us the XMI produced in the two cases if that reduced project cannot be imported ?Heterocyclic
XMI transfer works only per coincidence. If you're lucky, fine. If not: ask the tool provider how/whether the source from the producer is supported. Most tools put their own flavor inside XMI and others either get confused or give up.Aurea
S
3

In StarUML Github Issues there is something very similar to you issue.

I had the same problem and the workaround proposed worked for me, search for file "xmi-reader.js", then change in function "loadFromFile" the line:

var XMINode = dom.getElementsByTagName('XMI')[0]

to

var XMINode = dom.getElementsByTagName('xmi:XMI')[0]

Adding the name space "xmi:" to the name of the element makes it work.

Depending on you version of StarUML the file name could be xmi21-reader.js .

Slier answered 5/11, 2020 at 9:12 Comment(1)
Thanks a lot! On Windows 7 the file to edit is C:\Users\YourUser\AppData\Roaming\StarUML\extensions\user\staruml.xmi\xmi21-reader.jsEichler

© 2022 - 2024 — McMap. All rights reserved.