occiware/ecore

Weird/Incomplete EMF serialization of OCCI configurations

Opened this issue · 1 comments

We have made (and demonstrated) a Sirius modeler for our Roboconf extension.
This extension is defined here.

Among other things, we have defined facets and components as specialized resources.
When we drop such elements on our Sirius diagrams, they are saved as resources XML elements. Something like...

<resources xsi:type="roboconfgraph:RoboconfFacet" id="0efc24dd-5a67-4df6-998b-a58d3a3024cc" title="0efc24dd-5a67-4df6-998b-a58d3a3024cc" name="Facet 6"/>

When we validate such diagrams, we get the following error...

The required feature 'kind' of '<Configuration>::Facet 6' must be set

When we add links between our resources, the kind is set automatically.

<resources xsi:type="roboconfgraph:RoboconfComponent" id="c658608d-bf72-4fbf-92e3-966833502cfc" title="c658608d-bf72-4fbf-92e3-966833502cfc" name="MySQL" installerName="script">
    <kind href="http://schemas.ogf.org/occi/core#//@kinds[term='resource']"/>
    <attributes name="occi.core.id" value="c658608d-bf72-4fbf-92e3-966833502cfc"/>
    <attributes name="occi.core.title" value="c658608d-bf72-4fbf-92e3-966833502cfc"/>
  </resources>

Same thing if we set a new attribute's value.
But nothing with basic attributes (id, title). Given the content of the kind attribute, and given the way this extension was modelled, I would expect the EMF model to serialize everything correctly, that is to say automatically adding the occi.core.id and occi.core.title attributes, as well as setting the kind for all the resources.

Any idea about this?
This is really blocking, because it is almost impossible to create a valid diagram from an OCCI extension. I tried to compare with other modellers, but I failed to find a significant difference. Any help would be appreciated.

This problem also occurs with links.
The kind sub-element is missing in the serialization.