Enterprise Architect version 13

download
purchase

English Chinese (Simplified) Czech Dutch French German Italian Korean Polish Portuguese Russian Slovak Spanish Swedish

My Profile

Social Media Channels

facebook google plus twitter youtube linkedin

Wednesday, 20 February 2013 09:58

How-to import an example model from "A Practical Guide to SysML (second edition)"

Written by 

Morgan Kauffmann has published the second edition of “A Practical Guide to SysML” by Sanford Friedenthal, Alan Moore and Rick Steiner (ISBN 978-0-12-385206-9). The authors have made a very complete selection of supporting materials available for download from http://www.elsevierdirect.com/v2/companion.jsp?ISBN=9780123852069. These companion resources include the “Air Compressor”, “Automobile”, “Distiller”, and “Security System” example models, as described in the book. Unfortunately, the model files are only available in MagicDraw tool format (although the authors have also provided HTML reports for use by anyone who do not have access to MagicDraw). I decided to try importing the files into Sparx Enterprise Architect version 10, to support my work at Dunstan Thomas.

 

After you use a tool like 7-zip (http://www.7-zip.org) to extract the archive, you will see that the files have a “.mdxml” extension. Opening one of them in your favourite text editor will confirm that they are in XML format, based on the XMI 2.1 specification (http://schema.omg.org/spec/XMI/2.1), and also including some proprietary extensions to support the SysML profile (such as http://www.magicdraw.com/schemas/SysML_Profile_Extensions.xmi).

Here is a step-by-step breakdown of how I imported the “Air Compressor” example model into Sparx Enterprise Architect version 10:

  1. Despite the proprietary extensions, the model files are basically XMI, and so I simply changed/renamed the file extension from “.mdxml” to “.xml” (changing to “.xmi” also works).
  2. Either open a new project in Sparx Enterprise Architect, or at least add a new model into your working repository [right-click in the Project Browser and then select Add Model (root node)…].
  3. Rename the model to AirCompressor.
  4. Right-click AirCompressor (in the Project Browser), and then click Import Model from XMI…
  5. The Import Package from XMI window is displayed.  Click the ellipsis button alongside the Filename field and browse to the “Air Compressor-OMG Style_ReadOnly (from Alan).xml” model file. Did you remember to change/rename the “.mdxml” to “.xml” file extension first?
  6. Select Import Diagrams, Write Log file and Import using single transaction, and then click Import.
  7. Once the import has been completed, you can close the Import Package from XMI window.

 

You now have the model imported into Sparx Enterprise Architect, but you need to reorganize the model, and convert the diagrams and model elements to the SysML 1.3 profile. The outline steps for how to do this are:

  1. Looking inside the Project Browser, you can see a <<numberOwner>> Data view has been created beneath the AirCompressor model. This view contains two packages, <<model>> Air Compressor Model and MBSE Method, that are useful. There are also several spurious Package or <<profile>> Package elements that can be deleted.
  2. Continuing to work in the project browser, right-click AirCompressor and then select Add | Add View…
  3. Create each of Behaviour (Dynamic View), Parametrics (Class View), Requirements (Simple View) and Structure (Class View) in turn. Also create a “MBSE Method” (Dynamic View), if wanted.
  4. Work your way down through the <<model>> Air Compressor Model package hierarchy, changing each diagram to the relevant SysML 1.3 type. For example:
    1. Open the Figure Map, and then click Diagram | Advanced | Change Type…
    2. The Change Diagram Type window is displayed. Click SysML 1.3, Package, and then OK.
  5. Even after converting all of the diagrams to SysML 1.3 types, it is still necessary to synchronize the model elements. To do this work your way through the various SysML 1.3 tool palettes and:
    1. Right-click each element in the SysML tool palette, and then select Synchronize Stereotype if available. The Synch Profiled Elements window is displayed. Click OK.
    2. The Actions list will display a list of the elements that have had new tags or constraints added as a result of applying synchronizing the stereotype.
  6. Finally, move the converted elements underneath appropriate Behaviour, Parametrics, Requirements or Structure view. You can then delete any remaining superfluous packages that were created during the import.

Although this importing method is faster than manually recreating the example models from scratch, some manual editing is still necessary to:

  1. Fine-tune the layout and look of the example diagrams.
  2. Further change some of the SysML 1.3 diagram types to better represent the example models. For example, you can replace an instance of a Constraint Block with a Constraint Property.

In addition, some information does not make it intact through the import process. For example, it is necessary to manually add content into the ID and Text tagged values of the requirement elements. Some of the diagrams do not contain any elements, and this also has to be manually repaired.  Problems of this kind are largely related to each tool vendor’s interpretation of the OMG XMI specification itself, and are typically encountered whenever an attempt is made to move XMI between different implementations.

Read 9719 times
Rate this item
(1 Vote)
colin.coates

Colin Coates

Dunstan Thomas Holdings Limited (Senior Consultant)
 
I joined Dunstan Thomas Consulting in July 2012 to focus on delivering training and consulting for Sparx Enterprise Architect. My previous experience with UML modelling tools includes IBM Rational Rhapsody, and IBM Rational Software Architect. I also have many years of experience as a software engineer. My primary programming languages have been C++ and Ada, with occasional forays into Java, functional and scripting languages, and SQL. I contribute to the official Dunstan Thomas Consulting blog at http://dthomas-software.co.uk/blog. You can also read my personal, but professional, blog at http://mister-uml.blogspot.co.uk.

Website: dthomas-software.co.uk/consulting
More in this category: Colour your Knowledge »

2 comments

  • Comment Link Jonathan Murray Saturday, 07 September 2013 22:14 posted by Jonathan Murray

    The instruction is much appreciated ... but I am wondering if the 'MagicDraw SysML 1.2' XMI can be imported into 'SparxEX 1.3'.

    The 'Air Compressor' import is messy with components missing and rqmnts tagged as SysML1.2 stereotypes. Then after resetting the diagram types, the diagram kinds appear to be wrong.

    Also, synchronizing did not appear to change anything.

    At this point I will try starting from scratch with the MagicDraw html as a guide. (noting that the MagicDraw source does not include Figure 3.10.

  • Comment Link Jonathan Murray Saturday, 07 September 2013 22:14 posted by Jonathan Murray

    The instruction is much appreciated ... but I am wondering if the 'MagicDraw SysML 1.2' XMI can be imported into 'SparxEX 1.3'.

    The 'Air Compressor' import is messy with components missing and rqmnts tagged as SysML1.2 stereotypes. Then after resetting the diagram types, the diagram kinds appear to be wrong.

    Also, synchronizing did not appear to change anything.

    At this point I will try starting from scratch with the MagicDraw html as a guide. (noting that the MagicDraw source does not include Figure 3.10.

Login to post comments