Reputation: 51
We define test scenarios as UML activity diagrams in order to maintain reusability and understandability. Now, we have to link these diagrams to our Matlab or Visual Studio environment. Is there any practical way of transforming an activity diagram to an XML or similar format. Our design tool is Enterprise Architect(EA).
Upvotes: 1
Views: 871
Reputation: 36323
The answer to "is it possible" is Yes. If, --- you put a lot of effort into it.
An AD is a graphical representation of a part of the model. This is meant for humans. Unless you want to feed that into an AI it's much more meaningful to export the model itself. It is necessary to have a strict set of rules how the model is created. For example the activities should contain all actions involved. There shall be a single main AD in the actitity. That is because there are a couple of elements like fork/join which do not appear in the browser but are placed in the same package(/element not sure about that) as the diagram. So you would start with the single activity inital node and traverse the control/object flows to create some XML or what ever you would like.
It all depends, but a simple, quick export this way can be done in a day or so.
Upvotes: 1
Reputation: 13784
XMI (XML Metadata Interchange) is actually the standard exchange format defined by the OMG who also manage the UML standard.
You can export to XMI from most UML tools, including Sparx Systems Enterprise Architect.
In EA you select the package containing the Activity in the project browser and then select
Publish | Model Exchange | Export-XML | Export XML for current package
Here you have a number possible xml format to export the package to.
If you want to do this automated using the API you can use the method EA.Project.ExportPackageXMI (string PackageGUID, enumXMIType XMIType, long DiagramXML, long DiagramImage, long FormatXML, long UseDTD, string FileName)
or
EA.Project.ExportPackageXMIEx (string PackageGUID, enumXMIType XMIType, long DiagramXML, long DiagramImage, long FormatXML, long UseDTD, string FileName, ea.ExportPackageXMIFlag Flags)
See the manual for details on how to use these operations.
If you don't like the XMI format (which would be understandable) you can of course write your own export tool to your own XML schema. This would probably be my personal choice given the complexity of XMI.
Also keep in mind that the XMI standard rarely results in the same file when exporting the same model from different tools. Each vendor has it's own interpretation of the standard, resulting in different results for each tool.
Upvotes: 3