TransformationToolContest / ttc2016-live

TTC 2016 live contest materials
0 stars 4 forks source link

Cross-referencing in Dataflow models #6

Closed georghinkel closed 8 years ago

georghinkel commented 8 years ago

I just noticed the way cross-references are implemented in the dataflow models.

<elements xsi:type="df:AllInstances" name="AllMembers" field="member" model="Families" typeName="Member">
    <target xsi:type="df:AllInstances" href="families2persons.dataflow#|0"/>
  </elements>

What is the semantics of this? I have never seen the pipe symbol used before. The thing is, the target of the first AllInstances element should be the evaluation directly behind it - but that has index 1. Furthermore, I am not quite sure whether the model is correct, because the target element is typed as AllInstance element, which simply is wrong. Normally (well, for me it is getting normal that serialization in EMF is sometimes weired), a cross-reference should be serialized as an attribute. So the correct serialization should be something like

<elements xsi:type="df:AllInstances" name="AllMembers" field="member" model="Families" typeName="Member" target="/1" />

Please have a look.

agarciadom commented 8 years ago

Indeed, this is all very odd. I thought simply moving the root EObject from the Xtext EMF resource to the XMI EMF resource would suffice, but it's doing something very wrong. I'll look into this right now.

agarciadom commented 8 years ago

Right, it seems that the usual "move root EObject to other resource" approach doesn't work from Xtext to XMI. Instead, I'm doing an EcoreUtil.copy and now it's producing something sane. Thanks again for reporting this!