mbeddr / mbeddr.core

The mbeddr core. An extensible C
Eclipse Public License 2.0
226 stars 77 forks source link

Ecore Exporter: References not exported in xml file #2060

Open arimer opened 5 years ago

arimer commented 5 years ago

Although the root node contains several references to elements (in the same root), the ecore model exporter does not export them to the XML representation.

The following root node contains several places with references.

image

An export of this model to XML results in the following file:

<?xml version="1.0" encoding="ASCII"?>
<usfmodel:Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:usfmodel="myMetaModel">
  <ownedBlocks name="BLOCKA">
    <ownedPorts xsi:type="usfmodel:InPort" name="a_in"/>
    <ownedPorts xsi:type="usfmodel:OutPort" name="a_out"/>
  </ownedBlocks>
  <ownedBlocks name="BLOCKB">
    <ownedPorts xsi:type="usfmodel:InPort" name="b_in"/>
    <ownedPorts xsi:type="usfmodel:OutPort" name="b_out"/>
  </ownedBlocks>
  <ownedTypes name="PortType"/>
</usfmodel:Model>

Priviously existing references to the target PortType are not exported and therefor lost. This means the exported model instances are invalid, acordingly to the specified ecore metamodel and a re-import of the very same XML file would result in a broken MPS model.

arimer commented 5 years ago

Just to provide more information I add the concept declaration of this OutPort concept and the hierarchy it is in.

image

Maybe there is a problem with inherited references/children?