mbeddr.core icon indicating copy to clipboard operation
mbeddr.core copied to clipboard

Ecore Exporter: References not exported in xml file

Open arimer opened this issue 5 years ago • 1 comments

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 avatar Apr 04 '19 10:04 arimer

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?

arimer avatar Apr 04 '19 10:04 arimer