Resolve Ecore Cross Reference [message #949027] |
Thu, 18 October 2012 16:04 |
Florian B. Messages: 21 Registered: July 2012 Location: Hamburg Germany |
Junior Member |
|
|
Hi folks,
I have a problem concerning the resolving of ecore cross references.
In my model I have cross references from entities to the same entity in a different file.
In my ecore model the reference's upper bound is set to unbounded and the lower bound is set to 1.
The problem is, when the XML are parsed and I want to access the referenced objects in foo as single entities, these objects (in my case "ports") are null. It seems the factory returns just new objects of the types.
<foo>
<refPort>bar_test.bar_specification#//@devices/@device[name='testDevice1']/@port[name='TestDevice1Port']</refPort>
<refPort>bar_test.bar_specification#//@devices/@device[name='testDevice2']/@port[name='TestDevice2Port']</refPort>
</foo>
The weird thing is, the references seems to be resolved, if only one referenced object is defined in the XML document as attribute of foo, like the following example.
<foo
refport="bar_test.bar_specification#//@devices/@device[name='testDevice1']/@port[name='TestDevice1Port']" />
Maybe some properties are wrong in the .ecore ?
Thx again,
Florian
EDIT1:
I also tried to resolve the references with the static method EcoreUtil.resolveAll()
[Updated on: Thu, 18 October 2012 16:09] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.01971 seconds