Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Ecore Tools » Resolve Ecore Cross Reference
Resolve Ecore Cross Reference [message #949027] Thu, 18 October 2012 12:04
Florian B. is currently offline 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 12:09]

Report message to a moderator

Previous Topic:Ecore editor doesn't find a file
Next Topic:Creating Diagrams for a subset of objects in the Ecore Model
Goto Forum:
  


Current Time: Sat Apr 19 16:00:35 EDT 2014

Powered by FUDForum. Page generated in 0.21101 seconds