How to use XMI EA data format for import/export
In LUY, it is possible to export and import data using the XMI EA data format.
It is recommended to use the Excel export/import because it allows an easier way to view, create and manipulate data.
The content of a valid XMI file looks as follows:
<?xml version="1.0" encoding="UTF-8"?> <iteraplan:Container xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:iteraplan="urn:iteraplan"> <!-- put your data here --> </iteraplan:Container>
It is strongly recommended that the imported XMI files follow this structure. Otherwise, the import will fail.
<contents xsi:type="iteraplan:InformationSystem" id="1" name="Example IS # 1.0" description="Examplary information system" </-- other attribute values for type InformationSystem -->/> <contents xsi:type="iteraplan:InformationSystem" id="2" name="Example IS # 1.1" description="Examplary information system with reference to parent system" parent="#1" </-- other attribute values for type InformationSystem-->/> <contents xsi:type="iteraplan:BusinessUnit" id="1" name="Example BU" description="Examplary business unit" </-- other attribute values for type Business Unit-->/> <!-- other data (as "contents") -->
Each line of the XMI file defines a single object, its attributes, and its references as they are defined in the corresponding file.
The content of an XMI file can be edited or enlarged by additional objects. Therefore, it is strongly recommended that every referenced object is defined in the XMI file as well. In the example above, the content defines two information systems and one business unit.
References can only be resolved if the referenced instance is defined within the same file.
To simplify the modification of data within XMI files, it is useful to use an already exported XMI file as a basis for further handling, as the complexity of the development of an XMI file from scratch can increase rapidly.
Example use case: editing data
To edit the content of XMI files by use an XML editor. Importing the edited XMI file will update all affected persisted objects by overriding the instances with the same ID.
Only change IDs in order to solve conflicts between XMI data and already persisted objects. In other cases, an import may lead to undesirable changes. When changing an ID inside the XMI file, confirm that the change is made for every occurrence, or the import may fail.
If one object is referenced by another one, edit the ID in this reference as well.
Example use case: creating new data
It is possible to create new building blocks, attributes and objects of all other classes defined in the meta model by creating XMI files with an XML editor. Before starting the import-process for this file, confirm that every recommended attribute (an attribute is recommended if its definition in the file defines a "lowerBound" of "1") is set for all created instances.
When creating data, be sure to leave the id attribute blank (note that no other attribute may be left blank). If the id attribute was set in the XMI, LUY will update existing objects matching those ids rather than creating new ones.
During the import, LUY always assigns the next unused id to a created object. Whenever objects are created in this process, export the latest XMI file before applying any further changes.