Microsoft Visio 2003 incluía el componente XMI Export para guardar modelos UML en formato XMI.
Esto no era posible en Microsoft Visio 2007 hasta ahora, con la salida del Microsoft Visio Service Pack 2 que incluye una nueva versión de este componente (instrucciones de uso al final)
Aunque considero muy positivo que Visio ofrezca algún tipo de soporte para XMI, mis primeras impresiones no son muy buenas: el fichero generado es exageradamente grande, parece que sólo se exportan los diagramas de clases (cosa que ya pasaba con el Visio 2003) y, lo más sorprendente, la exportación depende del lenguaje con el que se use Visio !! (es decir, el fichero XMI varía dependiendo de si se usa el Visio en español o en inglés).
Por ejemplo, para indicar que un association end no es una agregación, Visio generaría el siguiente XML Element para los usuarios de Visio en Español:
- Foundation.Core.AssociationEnd.aggregation xmi.value=”ninguno”
pero en cambio generaría éste otro para los usuarios en Inglés:
-
Foundation.Core.AssociationEnd.aggregation xmi.value=”none”
donde “none” es la versión inglesa de “ninguno”. Esto es muy serio ya que implica que para importar un fichero XMI generado por Visio tendríamos que tener en cuenta estas variaciones lingüísticas. Increíble. Esperemos que esto se arregle en futuras versiones.
Como ejemplo, éste es el archivo XMI (¡más de 500k!) para este modelo UML:
Además, activar el componente XMI Export no es tarea fácil. Gracias a la ayuda del Visio Insights msdn blog
, he conseguido descubrir como configurarlo. Después de instalar el SP2, hay que ir a “Herramientas->Macros->Abrir el editor de Visual Basic” y escribir y ejecutar el siguiente código:
Sub ExportXMI()
Application.Addons(“UML Background Add-on”).Run (“/CMD=400 /XMIFILE=”"C:\file.xmi”"”)
End Sub
Si estáis interesados en importar diagramas de clase UML hechos con Visio en otras herramientas como ArgoUML, Poseidon o Eclipse UML2, provad mi servicio de transformación de ficheros XMI
Si te ha gustado esta entrada, puedes subscribirte a este blog y/o seguirme en twitter twitter
Y si realmente te ha gustado ayúdame a hacerlo llegar a otros utilizando los bookmarks que tienes a continuación:
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. lmunday@gmail.com
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)