5

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

Spectre_k9
  • 51
  • 1
  • 3
  • 3
    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 ? – bruno Feb 16 '20 at 17:35
  • 2
    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. – qwerty_so Feb 16 '20 at 18:07

1 Answers1

2

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 .

LeonFibuck
  • 336
  • 2
  • 12
  • Thanks a lot! On Windows 7 the file to edit is `C:\Users\YourUser\AppData\Roaming\StarUML\extensions\user\staruml.xmi\xmi21-reader.js` – 244an Mar 12 '21 at 12:10