5.3 Design data export and import

MetaEdit+ provides means to export and import design data between MetaEdit+ repositories, and with the API or Workbench versions also with other tools capable of importing or exporting definitions in XML format. It is possible to export and import both type (metamodel) and instance (model) level data. MetaEdit+ provides two formats for data exchange: a complete native binary format that enables export/import between two MetaEdit+ repositories and an open XML based format for wider tool integration.

Exporting graphs

To export graphs:
1)Open the projects containing graphs to be exported. You should generally commit or abandon to ensure that you do not have uncommitted changes, to avoid exporting a state that you later abandon. MetaEdit+ warns you about uncommitted changes during export. It is also best to close all open editors while exporting, particular for large exports to binary formats.
2)In MetaEdit+, all export activities take place in the Graph Manager. You can open the Graph Manager from the Launcher either by pressing the Export button on the toolbar or by selecting Browsers | Graph Manager from the menu.
3)In the Graph Manager, select the graphs to be exported from the left-hand list by clicking them with the left mouse button. You can select or deselect all graphs with the buttons below the list (Select All, Invert Selection).

Figure 5-8. Graph Manager.

4)Press the arrow button between the lists. This updates the right-hand list by selecting the elements that are included in the selected graphs. This operation may take some time, especially the first time, when all the data must first be loaded from the repository. The selected elements are ordered by their metatype (Graph, Object, Relationship, Role), type name, and name. You may choose any of the elements from the list on the right to see the reason why that item was included. Note that for binary export, graphs reached by explosion, decomposition or property links will be included along with their properties, but without their contents; similarly the types of their contents will not be exported. To export the whole graphs, include them in the selection in the left list.
5)Depending on whether you want to export elements as a binary patch or XML, press either Save as Patch or Export to XML button at the bottom of the Graph Manager. Saving as a patch will create a binary file with extension .mec whereas exporting to XML will result an .mxm file.
6)Give a name for the export file (with extension .mec or .mxm). With binary export you are also asked to give the name for your current repository. The repository name is needed because in the case of a binary patch target repositories remember the source repositories from which they have imported models. The use of the same repository name allows models to be exported from a given source repository to a given target repository many times, updating the previously imported models. If the name is different, new graphs, objects etc. will be created. If the name is the same, the previously imported models will be updated. If the name is the same, but the second export was actually from a different repository, importing would cause serious errors, so an error message will be displayed and MetaEdit+ must be exited. You should thus take care to make the names you use for your repositories unique.