Microsoft Visio 2003 included a XMI Export component to export UML models to XMI-compliant files.
However this was not possible in Microsoft Visio 2007 until now with the recent release of the Microsoft Visio Service Pack 2 that contains a new version of the XMI Export component (instructions below)
Although I think it is very positive that Visio offers some kind of XMI export support, my first impression is not very optimistic: the generated XMI is too verbose, it seems that only class diagram elements are exported (as happened with Visio 2003) and more surprisingly, the XMI export is language-dependent!! (that is, the XMI file presents small differences depending on the user predefined language).
For instance, to indicate that an association end it is not an aggregation, Visio would generate the following XML Element for Spanish Visio users:
- Foundation.Core.AssociationEnd.aggregation xmi.value=”ninguno”
but this would be the XML element generated for English users:
- Foundation.Core.AssociationEnd.aggregation xmi.value=”none”
where “ninguno” is the Spanish word for “none”. This implies that to import the generated XMI in another CASE tool we must deal with these language variations. Incredible. Let’s hope this will be fixed IN future releases.
AS an example, this IS the Visio XMI file (MORE than 500k!) CORRESPONDING TO this simple UML model:
Activating the XMI export component IS NOT an easy task either. Thanks TO the help I’ve found in the Visio Insights msdn blog
, I’ve managed TO find out that the process IS the following. After installing the SP2, go TO “Tools->Macros->Open the Visual Basic Editor” AND WRITE AND EXECUTE the following code:
Sub ExportXMI()
Application.Addons(“UML Background Add-on”).Run (“/CMD=400 /XMIFILE=””C:\file.xmi”””)
END Sub
FNR Pearl Chair. Head of the Software Engineering RDI Unit at LIST. Affiliate Professor at University of Luxembourg. More about me.
Thanks for posting the file – saved me the hassle of generating one.
It’s quite different FROM the XMI produced by the previous ADD-ON (which bizarrely claimed TO be UML 1.2 – a revision OF UML that never officially saw the light OF DAY).
As you point out it IS unusually verbose – due partly TO the use OF XML elements rather than XML attributes FOR absolutely every VALUE including xmi.id.
However the huge SIZE OF the file IS due TO the presence OF a Subsystem element called “Sistema 1 de UML” which contains a large NUMBER OF ‘standard’ Stereotype definitions AND datatype definitions FOR 4 different programming languages (IDL, C++, C#, VB – surprise surprise NO Java). Removing this subsystem (which would be identical FOR ANY model) takes the SIZE down TO 42Kb!
Also, each Class IN your model has 5 tagged VALUES applied: (sematica, persistencia, ubicacion, documentacion, responsilitad) (Attributes have just the LAST 2) even though they have NO VALUES. AND that’s a general theme – lots of empty elements unnecessarily included. And default values likewise.
One bug I noticed – multiplicity is serlaized as * rather than as 2 separate values lower=0 and upper = -1 (the convention for * at UML 1.x).
Ok, I have managed to export my model. Edit it in another UML tool. Now I want to import back into Visio.
Les. [email protected]
unfortunately this is not possible since Visio does not offer an import functionality
Hello,
I try to get this in visio, i want to make in uml a class with 2 attributes as the pk, and then xmi export.
any idea?
Thanks for help.
so you´ll need to define that information as a UML profile (btw, profiles are not yet supported by the XMItoXMI transformation service)