Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problem with unresolvable cross references
Problem with unresolvable cross references [message #425036] Thu, 13 November 2008 20:56 Go to next message
Eclipse UserFriend
Originally posted by: eike.thaden.offis.de

Hello,

I have a problem with cross references which are not resovable.

I have two resources (two distinct files in the same
directory): "Project4_with_Task_only.hrc":
<?xml version="1.0" encoding="ASCII"?>
<hrcK:System xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:hrcK="http://www.speeds.eu.com/2007/hrc/kernel"
name="Project4_with_Tasks_only">
<subPackage name="RhpProperties"/>
<subPackage name="Project4_with_Task_only">
<declared xsi:type="hrcK:RichComponent"
href="Project4_with_Task_only.SpeedSmoothing.hrc#/"/>
</subPackage>
</hrcK:System>

and "Project4_with_Task_only.SpeedSmoothing.hrc":
<?xml version="1.0" encoding="ASCII"?>
<hrcK:RichComponent xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:hrcK="http://www.speeds.eu.com/2007/hrc/kernel"
name="SpeedSmoothing">
<declarationZone xsi:type="hrcK:Package"
href="Project4_with_Tasks_only.hrc#//@subPackage.1"/>
</hrcK:RichComponent>

Starting with the RichComponent named "SpeedSmoothing", I can get its
subPackage by following the "declarationZone" href. But in this subPackage
I cannot follow the "declared" href back to the original RichComponent. Is
there a general problem with this?

Accidently (and for me unchangeable) the declared relation is a containment
relation. Does that maybe cause the problems with splitting the parts into
two resources?

Sorry for the quite bad explanation of the problem, but I don't know how to
better explain it.

Best regards
Eike
Re: Problem with unresolvable cross references [message #425038 is a reply to message #425036] Thu, 13 November 2008 21:50 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Eike,

Comments below.

Eike Thaden wrote:
> Hello,
>
> I have a problem with cross references which are not resovable.
>
> I have two resources (two distinct files in the same
> directory): "Project4_with_Task_only.hrc":
> <?xml version="1.0" encoding="ASCII"?>
> <hrcK:System xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:hrcK="http://www.speeds.eu.com/2007/hrc/kernel"
> name="Project4_with_Tasks_only">
> <subPackage name="RhpProperties"/>
> <subPackage name="Project4_with_Task_only">
> <declared xsi:type="hrcK:RichComponent"
> href="Project4_with_Task_only.SpeedSmoothing.hrc#/"/>
>
So a nice relative reference to the root object of a file in the same
folder...
> </subPackage>
> </hrcK:System>
>
> and "Project4_with_Task_only.SpeedSmoothing.hrc":
> <?xml version="1.0" encoding="ASCII"?>
> <hrcK:RichComponent xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:hrcK="http://www.speeds.eu.com/2007/hrc/kernel"
> name="SpeedSmoothing">
> <declarationZone xsi:type="hrcK:Package"
> href="Project4_with_Tasks_only.hrc#//@subPackage.1"/>
>
And a reference back...
> </hrcK:RichComponent>
>
> Starting with the RichComponent named "SpeedSmoothing", I can get its
> subPackage by following the "declarationZone" href. But in this subPackage
> I cannot follow the "declared" href back to the original RichComponent. Is
> there a general problem with this?
>
No, that should work.
> Accidently (and for me unchangeable) the declared relation is a containment
> relation. Does that maybe cause the problems with splitting the parts into
> two resources?
>
Is resolve proxies true for that reference? Did you set GenModel
Containment Proxies to true?
> Sorry for the quite bad explanation of the problem, but I don't know how to
> better explain it.
>
> Best regards
> Eike
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Problem with unresolvable cross references [message #425049 is a reply to message #425038] Fri, 14 November 2008 11:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Eike.Thaden.offis.de

Ed Merks wrote:

> Eike,
>
> Comments below.
>
> Eike Thaden wrote:
>> Hello,
>>
>> I have a problem with cross references which are not resovable.
>>
>> I have two resources (two distinct files in the same
>> directory): "Project4_with_Task_only.hrc":
>> <?xml version="1.0" encoding="ASCII"?>
>> <hrcK:System xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:hrcK="http://www.speeds.eu.com/2007/hrc/kernel"
>> name="Project4_with_Tasks_only">
>> <subPackage name="RhpProperties"/>
>> <subPackage name="Project4_with_Task_only">
>> <declared xsi:type="hrcK:RichComponent"
>> href="Project4_with_Task_only.SpeedSmoothing.hrc#/"/>
>>
> So a nice relative reference to the root object of a file in the same
> folder...
>> </subPackage>
>> </hrcK:System>
>>
>> and "Project4_with_Task_only.SpeedSmoothing.hrc":
>> <?xml version="1.0" encoding="ASCII"?>
>> <hrcK:RichComponent xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:hrcK="http://www.speeds.eu.com/2007/hrc/kernel"
>> name="SpeedSmoothing">
>> <declarationZone xsi:type="hrcK:Package"
>> href="Project4_with_Tasks_only.hrc#//@subPackage.1"/>
>>
> And a reference back...
>> </hrcK:RichComponent>
>>
>> Starting with the RichComponent named "SpeedSmoothing", I can get its
>> subPackage by following the "declarationZone" href. But in this
>> subPackage I cannot follow the "declared" href back to the original
>> RichComponent. Is there a general problem with this?
>>
> No, that should work.
>> Accidently (and for me unchangeable) the declared relation is a
>> containment relation. Does that maybe cause the problems with splitting
>> the parts into two resources?
>>
> Is resolve proxies true for that reference? Did you set GenModel
> Containment Proxies to true?
There are other references between different resources where proxy
resolution works well (not contained in my example).

However the generated code for the "declared" reference looks like this:
public EList<ReusableElement> getDeclared() {
if (declared == null) {
declared = new
EObjectContainmentWithInverseEList<ReusableElement>(ReusableElement.class,
this, KernelPackage.DECLARATION_ZONE__DECLARED,
KernelPackage.REUSABLE_ELEMENT__DECLARATION_ZONE);
}
return declared;
}

There should be some proxy resolution code, right? If this is reason for all
my problems, I'll have to talk to those responsible for modeling in our
project...

>> Sorry for the quite bad explanation of the problem, but I don't know how
>> to better explain it.
>>
>> Best regards
>> Eike
>>
Re: Problem with unresolvable cross references [message #425061 is a reply to message #425049] Fri, 14 November 2008 13:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080106040704090404000309
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Eike,

Comments below.


Eike Thaden wrote:
> Ed Merks wrote:
>
>
>> Eike,
>>
>> Comments below.
>>
>> Eike Thaden wrote:
>>
>>> Hello,
>>>
>>> I have a problem with cross references which are not resovable.
>>>
>>> I have two resources (two distinct files in the same
>>> directory): "Project4_with_Task_only.hrc":
>>> <?xml version="1.0" encoding="ASCII"?>
>>> <hrcK:System xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:hrcK="http://www.speeds.eu.com/2007/hrc/kernel"
>>> name="Project4_with_Tasks_only">
>>> <subPackage name="RhpProperties"/>
>>> <subPackage name="Project4_with_Task_only">
>>> <declared xsi:type="hrcK:RichComponent"
>>> href="Project4_with_Task_only.SpeedSmoothing.hrc#/"/>
>>>
>>>
>> So a nice relative reference to the root object of a file in the same
>> folder...
>>
>>> </subPackage>
>>> </hrcK:System>
>>>
>>> and "Project4_with_Task_only.SpeedSmoothing.hrc":
>>> <?xml version="1.0" encoding="ASCII"?>
>>> <hrcK:RichComponent xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:hrcK="http://www.speeds.eu.com/2007/hrc/kernel"
>>> name="SpeedSmoothing">
>>> <declarationZone xsi:type="hrcK:Package"
>>> href="Project4_with_Tasks_only.hrc#//@subPackage.1"/>
>>>
>>>
>> And a reference back...
>>
>>> </hrcK:RichComponent>
>>>
>>> Starting with the RichComponent named "SpeedSmoothing", I can get its
>>> subPackage by following the "declarationZone" href. But in this
>>> subPackage I cannot follow the "declared" href back to the original
>>> RichComponent. Is there a general problem with this?
>>>
>>>
>> No, that should work.
>>
>>> Accidently (and for me unchangeable) the declared relation is a
>>> containment relation. Does that maybe cause the problems with splitting
>>> the parts into two resources?
>>>
>>>
>> Is resolve proxies true for that reference? Did you set GenModel
>> Containment Proxies to true?
>>
> There are other references between different resources where proxy
> resolution works well (not contained in my example).
>
> However the generated code for the "declared" reference looks like this:
> public EList<ReusableElement> getDeclared() {
> if (declared == null) {
> declared = new
> EObjectContainmentWithInverseEList<ReusableElement>(ReusableElement.class,
> this, KernelPackage.DECLARATION_ZONE__DECLARED,
> KernelPackage.REUSABLE_ELEMENT__DECLARATION_ZONE);
> }
> return declared;
> }
>
> There should be some proxy resolution code, right?
No, it would use EObjectContainmentWithInverseEList.Resolving.
> If this is reason for all
> my problems, I'll have to talk to those responsible for modeling in our
> project...
>
I'm still not sure if I've fully understood the problem. I'm not sure
how you'd have proxies if the feature wouldn't try to resolve them.
>
>>> Sorry for the quite bad explanation of the problem, but I don't know how
>>> to better explain it.
>>>
>>> Best regards
>>> Eike
>>>
>>>
>
>

--------------080106040704090404000309
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Eike,<br>
<br>
Comments below.<br>
<br>
<br>
Eike Thaden wrote:
<blockquote cite="mid:gfjorv$u6u$1@build.eclipse.org" type="cite">
<pre wrap="">Ed Merks wrote:

</pre>
<blockquote type="cite">
<pre wrap="">Eike,

Comments below.

Eike Thaden wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hello,

I have a problem with cross references which are not resovable.

I have two resources (two distinct files in the same
directory): "Project4_with_Task_only.hrc":
&lt;?xml version="1.0" encoding="ASCII"?&gt;
&lt;hrcK:System xmi:version="2.0" xmlns:xmi=<a class="moz-txt-link-rfc2396E" href="http://www.omg.org/XMI">"http://www.omg.org/XMI"</a>
xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>
xmlns:hrcK=<a class="moz-txt-link-rfc2396E" href="http://www.speeds.eu.com/2007/hrc/kernel">"http://www.speeds.eu.com/2007/hrc/kernel"</a>
name="Project4_with_Tasks_only"&gt;
&lt;subPackage name="RhpProperties"/&gt;
&lt;subPackage name="Project4_with_Task_only"&gt;
&lt;declared xsi:type="hrcK:RichComponent"
href="Project4_with_Task_only.SpeedSmoothing.hrc#/"/&gt;

</pre>
</blockquote>
<pre wrap="">So a nice relative reference to the root object of a file in the same
folder...
</pre>
<blockquote type="cite">
<pre wrap=""> &lt;/subPackage&gt;
&lt;/hrcK:System&gt;

and "Project4_with_Task_only.SpeedSmoothing.hrc":
&lt;?xml version="1.0" encoding="ASCII"?&gt;
&lt;hrcK:RichComponent xmi:version="2.0" xmlns:xmi=<a class="moz-txt-link-rfc2396E" href="http://www.omg.org/XMI">"http://www.omg.org/XMI"</a>
xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>
xmlns:hrcK=<a class="moz-txt-link-rfc2396E" href="http://www.speeds.eu.com/2007/hrc/kernel">"http://www.speeds.eu.com/2007/hrc/kernel"</a>
name="SpeedSmoothing"&gt;
&lt;declarationZone xsi:type="hrcK:Package"
href=<a class="moz-txt-link-rfc2396E" href="mailto:Project4_with_Tasks_only.hrc#//@subPackage.1"> "Project4_with_Tasks_only.hrc#//@subPackage.1"</a>/&gt;

</pre>
</blockquote>
<pre wrap="">And a reference back...
</pre>
<blockquote type="cite">
<pre wrap="">&lt;/hrcK:RichComponent&gt;

Starting with the RichComponent named "SpeedSmoothing", I can get its
subPackage by following the "declarationZone" href. But in this
subPackage I cannot follow the "declared" href back to the original
RichComponent. Is there a general problem with this?

</pre>
</blockquote>
<pre wrap="">No, that should work.
</pre>
<blockquote type="cite">
<pre wrap="">Accidently (and for me unchangeable) the declared relation is a
containment relation. Does that maybe cause the problems with splitting
the parts into two resources?

</pre>
</blockquote>
<pre wrap="">Is resolve proxies true for that reference? Did you set GenModel
Containment Proxies to true?
</pre>
</blockquote>
<pre wrap=""><!---->There are other references between different resources where proxy
resolution works well (not contained in my example).

However the generated code for the "declared" reference looks like this:
public EList&lt;ReusableElement&gt; getDeclared() {
if (declared == null) {
declared = new
EObjectContainmentWithInverseEList&lt;ReusableElement&am p;gt;(ReusableElement.class,
this, KernelPackage.DECLARATION_ZONE__DECLARED,
KernelPackage.REUSABLE_ELEMENT__DECLARATION_ZONE);
}
return declared;
}

There should be some proxy resolution code, right? </pre>
</blockquote>
No, it would use EObjectContainmentWithInverseEList.Resolving.
<blockquote cite="mid:gfjorv$u6u$1@build.eclipse.org" type="cite">
<pre wrap="">If this is reason for all
my problems, I'll have to talk to those responsible for modeling in our
project...
</pre>
</blockquote>
I'm still not sure if I've fully understood the problem.&nbsp; I'm not sure
how you'd have proxies if the feature wouldn't try to resolve them.<br>
<blockquote cite="mid:gfjorv$u6u$1@build.eclipse.org" type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Sorry for the quite bad explanation of the problem, but I don't know how
to better explain it.

Best regards
Eike

</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>

--------------080106040704090404000309--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Problem with unresolvable cross references [message #425140 is a reply to message #425061] Sat, 15 November 2008 17:57 Go to previous message
Eclipse UserFriend
Originally posted by: Eike.Thaden.offis.de

Ed Merks wrote:

> Eike,
>
> Comments below.
>
>
> Eike Thaden wrote:
>> Ed Merks wrote:
>>
>>
>>> Eike,
>>>
>>> Comments below.
>>>
>>> Eike Thaden wrote:
>>>
>>>> Hello,
>>>>
>>>> I have a problem with cross references which are not resovable.
>>>>
>>>> I have two resources (two distinct files in the same
>>>> directory): "Project4_with_Task_only.hrc":
>>>> <?xml version="1.0" encoding="ASCII"?>
>>>> <hrcK:System xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>> xmlns:hrcK="http://www.speeds.eu.com/2007/hrc/kernel"
>>>> name="Project4_with_Tasks_only">
>>>> <subPackage name="RhpProperties"/>
>>>> <subPackage name="Project4_with_Task_only">
>>>> <declared xsi:type="hrcK:RichComponent"
>>>> href="Project4_with_Task_only.SpeedSmoothing.hrc#/"/>
>>>>
>>>>
>>> So a nice relative reference to the root object of a file in the same
>>> folder...
>>>
>>>> </subPackage>
>>>> </hrcK:System>
>>>>
>>>> and "Project4_with_Task_only.SpeedSmoothing.hrc":
>>>> <?xml version="1.0" encoding="ASCII"?>
>>>> <hrcK:RichComponent xmi:version="2.0"
>>>> xmlns:xmi="http://www.omg.org/XMI"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>> xmlns:hrcK="http://www.speeds.eu.com/2007/hrc/kernel"
>>>> name="SpeedSmoothing">
>>>> <declarationZone xsi:type="hrcK:Package"
>>>> href="Project4_with_Tasks_only.hrc#//@subPackage.1"/>
>>>>
>>>>
>>> And a reference back...
>>>
>>>> </hrcK:RichComponent>
>>>>
>>>> Starting with the RichComponent named "SpeedSmoothing", I can get its
>>>> subPackage by following the "declarationZone" href. But in this
>>>> subPackage I cannot follow the "declared" href back to the original
>>>> RichComponent. Is there a general problem with this?
>>>>
>>>>
>>> No, that should work.
>>>
>>>> Accidently (and for me unchangeable) the declared relation is a
>>>> containment relation. Does that maybe cause the problems with splitting
>>>> the parts into two resources?
>>>>
>>>>
>>> Is resolve proxies true for that reference? Did you set GenModel
>>> Containment Proxies to true?
>>>
>> There are other references between different resources where proxy
>> resolution works well (not contained in my example).
>>
>> However the generated code for the "declared" reference looks like this:
>> public EList<ReusableElement> getDeclared() {
>> if (declared == null) {
>> declared = new
>>
EObjectContainmentWithInverseEList<ReusableElement>(ReusableElement.class,
>> this, KernelPackage.DECLARATION_ZONE__DECLARED,
>> KernelPackage.REUSABLE_ELEMENT__DECLARATION_ZONE);
>> }
>> return declared;
>> }
>>
>> There should be some proxy resolution code, right?
> No, it would use EObjectContainmentWithInverseEList.Resolving.
>> If this is reason for all
>> my problems, I'll have to talk to those responsible for modeling in our
>> project...
>>
> I'm still not sure if I've fully understood the problem. I'm not sure
> how you'd have proxies if the feature wouldn't try to resolve them.
I finally checked the genmodel file. The reason for my problems is obviously
that "Containment Proxies" was set to false. Thank you for your help. I
think I can now ask our model guys to fix that problem as soon as possible.

For EMF experts this bug is easy to find. But for beginners like me, it even
takes a long time to understand the basic concepts of EMF, especially the
proxy stuff. And if you are not directly involved in the modeling and code
generation part, you just see unexpected java behaviours when using the
generated code.

>>
>>>> Sorry for the quite bad explanation of the problem, but I don't know
>>>> how to better explain it.
>>>>
>>>> Best regards
>>>> Eike
>>>>
>>>>
>>
>>
Previous Topic:Slow EMF model generation
Next Topic:Re: Dynamic EMF Editor
Goto Forum:
  


Current Time: Thu Mar 28 23:55:29 GMT 2024

Powered by FUDForum. Page generated in 0.03576 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top