Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Loaded list reference contains extraneous "null references"
Loaded list reference contains extraneous "null references" [message #418195] Fri, 04 April 2008 16:07 Go to next message
Daniel Tuohy is currently offline Daniel TuohyFriend
Messages: 41
Registered: July 2009
Member
Hello,

I'm seeing a problem when loading an object from a resource. For one
particular multi-valued reference for a particular type of contained object,
I am getting extraneous null references. They aren't missing, they just
shouldn't be there in the first place. The xml in the resource (in the file
test_schedule.xml) for an example object looks like this:

<tasks xmi:id="_mppFoQJKEd2xG_FIPUDu1w" name="task1"
cost="50000" duration="60" system="domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"
actualStart="2007-09-08T21:53:20.000-0400"
actualEnd="2007-11-07T21:53:20.000-0500"
predecessors="test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
outputs="test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"
resourceConflicts="domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w ">
</tasks>

Note that there is only one value in "predecessor". When I load from this
resource, the first predecessor is a "null"-valued Task, and the second is
the correct filler. If I immediately save the resource, the same object
looks like this (note the now duplicated reference in 'predecessors').

<tasks xmi:id="_mppFoQJKEd2xG_FIPUDu1w" name="task1"
cost="50000" duration="60" system="domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"
actualStart="2007-09-08T21:53:20.000-0400"
actualEnd="2007-11-07T21:53:20.000-0500"
predecessors="test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w
test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
outputs="test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"
resourceConflicts="domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w ">
</tasks>

The code I used for loading from the XML resource, inspecting the object in
the debugger, then saving the resource is these three lines:
resourceModelLoad.load( null );

Schedule loadedModel = (Schedule)resourceModelLoad.getContents().get(0);

resourceModelLoad.save(System.out,null);

Any idea what might be causing this?

Daniel
Re: Loaded list reference contains extraneous "null references" [message #418197 is a reply to message #418195] Fri, 04 April 2008 18:27 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Daniel,

It's a little hard to comment without knowing the model. Both
predecessors and outputs point at the same object, but only the one
feature has the duplication problem. Are these two features defined
differently in some way? Are the bidirectional? What's the full URI of
the resource that contains the XMI serialization you show below.


Daniel Tuohy wrote:
> Hello,
>
> I'm seeing a problem when loading an object from a resource. For one
> particular multi-valued reference for a particular type of contained object,
> I am getting extraneous null references. They aren't missing, they just
> shouldn't be there in the first place. The xml in the resource (in the file
> test_schedule.xml) for an example object looks like this:
>
> <tasks xmi:id="_mppFoQJKEd2xG_FIPUDu1w" name="task1"
> cost="50000" duration="60" system="domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"
> actualStart="2007-09-08T21:53:20.000-0400"
> actualEnd="2007-11-07T21:53:20.000-0500"
> predecessors="test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
> outputs="test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"
> resourceConflicts="domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w ">
> </tasks>
>
> Note that there is only one value in "predecessor". When I load from this
> resource, the first predecessor is a "null"-valued Task, and the second is
> the correct filler. If I immediately save the resource, the same object
> looks like this (note the now duplicated reference in 'predecessors').
>
> <tasks xmi:id="_mppFoQJKEd2xG_FIPUDu1w" name="task1"
> cost="50000" duration="60" system="domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"
> actualStart="2007-09-08T21:53:20.000-0400"
> actualEnd="2007-11-07T21:53:20.000-0500"
> predecessors="test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w
> test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
> outputs="test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"
> resourceConflicts="domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w ">
> </tasks>
>
> The code I used for loading from the XML resource, inspecting the object in
> the debugger, then saving the resource is these three lines:
> resourceModelLoad.load( null );
>
> Schedule loadedModel = (Schedule)resourceModelLoad.getContents().get(0);
>
> resourceModelLoad.save(System.out,null);
>
> Any idea what might be causing this?
>
> Daniel
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Loaded list reference contains extraneous "null references" [message #418198 is a reply to message #418197] Fri, 04 April 2008 18:51 Go to previous messageGo to next message
Daniel Tuohy is currently offline Daniel TuohyFriend
Messages: 41
Registered: July 2009
Member
Hi Ed,

Note that "outputs" and "predecessors" don't actually point to the same
object, the IDs are different. However, "outputs" and "predecessors" are
EOpposites of each other, although both are identically specified in the
Ecore model other than their names. I would also note that they are of the
same type (Task). So if Task B has Task A as a predecessor, then Task A has
Task B as an output.

The URI of the resource is "test_schedule.xml" (it contains all the Task
objects, there are no cross-document references).

"Ed Merks" <merks@ca.ibm.com> wrote in message
news:ft5rv9$1ed$1@build.eclipse.org...
> Daniel,
>
> It's a little hard to comment without knowing the model. Both
> predecessors and outputs point at the same object, but only the one
> feature has the duplication problem. Are these two features defined
> differently in some way? Are the bidirectional? What's the full URI of
> the resource that contains the XMI serialization you show below.
>
>
> Daniel Tuohy wrote:
>> Hello,
>>
>> I'm seeing a problem when loading an object from a resource. For one
>> particular multi-valued reference for a particular type of contained
>> object, I am getting extraneous null references. They aren't missing,
>> they just shouldn't be there in the first place. The xml in the resource
>> (in the file test_schedule.xml) for an example object looks like this:
>>
>> <tasks xmi:id="_mppFoQJKEd2xG_FIPUDu1w" name="task1"
>> cost="50000" duration="60"
>> system="domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"
>> actualStart="2007-09-08T21:53:20.000-0400"
>> actualEnd="2007-11-07T21:53:20.000-0500"
>> predecessors="test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
>> outputs="test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"
>> resourceConflicts="domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w ">
>> </tasks>
>>
>> Note that there is only one value in "predecessor". When I load from
>> this resource, the first predecessor is a "null"-valued Task, and the
>> second is the correct filler. If I immediately save the resource, the
>> same object looks like this (note the now duplicated reference in
>> 'predecessors').
>>
>> <tasks xmi:id="_mppFoQJKEd2xG_FIPUDu1w" name="task1"
>> cost="50000" duration="60"
>> system="domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"
>> actualStart="2007-09-08T21:53:20.000-0400"
>> actualEnd="2007-11-07T21:53:20.000-0500"
>> predecessors="test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w
>> test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
>> outputs="test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"
>> resourceConflicts="domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w ">
>> </tasks>
>>
>> The code I used for loading from the XML resource, inspecting the object
>> in the debugger, then saving the resource is these three lines:
>> resourceModelLoad.load( null );
>>
>> Schedule loadedModel = (Schedule)resourceModelLoad.getContents().get(0);
>>
>> resourceModelLoad.save(System.out,null);
>>
>> Any idea what might be causing this?
>>
>> Daniel
>>
>>
>>
Re: Loaded list reference contains extraneous "null references" [message #418200 is a reply to message #418198] Fri, 04 April 2008 19:27 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060707050306000907050809
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Daniel,

Comments below.

Daniel Tuohy wrote:
> Hi Ed,
>
> Note that "outputs" and "predecessors" don't actually point to the same
> object, the IDs are different.
Sorry, these darned things are a bit of a eye chart.
> However, "outputs" and "predecessors" are
> EOpposites of each other, although both are identically specified in the
> Ecore model other than their names.
That was my suspicion.
> I would also note that they are of the
> same type (Task). So if Task B has Task A as a predecessor, then Task A has
> Task B as an output.
>
> The URI of the resource is "test_schedule.xml" (it contains all the Task
> objects, there are no cross-document references).
>
The problem is maybe caused by the use of a relative URI for doing the
loading and saving. It's always best to use an absolute URI (that
includes a scheme, e.g., platform:/resource/project/abc.xml) so that
references to other resources can be made relative. In this case the
references look to be in the same resource too so maybe one of these
defects is related:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=218759
https://bugs.eclipse.org/bugs/show_bug.cgi?id=196495

Which version of EMF are you using?
> "Ed Merks" <merks@ca.ibm.com> wrote in message
> news:ft5rv9$1ed$1@build.eclipse.org...
>
>> Daniel,
>>
>> It's a little hard to comment without knowing the model. Both
>> predecessors and outputs point at the same object, but only the one
>> feature has the duplication problem. Are these two features defined
>> differently in some way? Are the bidirectional? What's the full URI of
>> the resource that contains the XMI serialization you show below.
>>
>>
>> Daniel Tuohy wrote:
>>
>>> Hello,
>>>
>>> I'm seeing a problem when loading an object from a resource. For one
>>> particular multi-valued reference for a particular type of contained
>>> object, I am getting extraneous null references. They aren't missing,
>>> they just shouldn't be there in the first place. The xml in the resource
>>> (in the file test_schedule.xml) for an example object looks like this:
>>>
>>> <tasks xmi:id="_mppFoQJKEd2xG_FIPUDu1w" name="task1"
>>> cost="50000" duration="60"
>>> system="domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"
>>> actualStart="2007-09-08T21:53:20.000-0400"
>>> actualEnd="2007-11-07T21:53:20.000-0500"
>>> predecessors="test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
>>> outputs="test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"
>>> resourceConflicts="domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w ">
>>> </tasks>
>>>
>>> Note that there is only one value in "predecessor". When I load from
>>> this resource, the first predecessor is a "null"-valued Task, and the
>>> second is the correct filler. If I immediately save the resource, the
>>> same object looks like this (note the now duplicated reference in
>>> 'predecessors').
>>>
>>> <tasks xmi:id="_mppFoQJKEd2xG_FIPUDu1w" name="task1"
>>> cost="50000" duration="60"
>>> system="domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"
>>> actualStart="2007-09-08T21:53:20.000-0400"
>>> actualEnd="2007-11-07T21:53:20.000-0500"
>>> predecessors="test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w
>>> test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
>>> outputs="test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"
>>> resourceConflicts="domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w ">
>>> </tasks>
>>>
>>> The code I used for loading from the XML resource, inspecting the object
>>> in the debugger, then saving the resource is these three lines:
>>> resourceModelLoad.load( null );
>>>
>>> Schedule loadedModel = (Schedule)resourceModelLoad.getContents().get(0);
>>>
>>> resourceModelLoad.save(System.out,null);
>>>
>>> Any idea what might be causing this?
>>>
>>> Daniel
>>>
>>>
>>>
>>>
>
>
>


--------------060707050306000907050809
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">
Daniel,<br>
<br>
Comments below.<br>
<br>
Daniel Tuohy wrote:
<blockquote cite="mid:ft5t7f$o1i$1@build.eclipse.org" type="cite">
<pre wrap="">Hi Ed,

Note that "outputs" and "predecessors" don't actually point to the same
object, the IDs are different. </pre>
</blockquote>
Sorry, these darned things are a bit of a eye chart.<br>
<blockquote cite="mid:ft5t7f$o1i$1@build.eclipse.org" type="cite">
<pre wrap="">However, "outputs" and "predecessors" are
EOpposites of each other, although both are identically specified in the
Ecore model other than their names.</pre>
</blockquote>
That was my suspicion.<br>
<blockquote cite="mid:ft5t7f$o1i$1@build.eclipse.org" type="cite">
<pre wrap=""> I would also note that they are of the
same type (Task). So if Task B has Task A as a predecessor, then Task A has
Task B as an output.

The URI of the resource is "test_schedule.xml" (it contains all the Task
objects, there are no cross-document references).
</pre>
</blockquote>
The problem is maybe caused by the use of a relative URI for doing the
loading and saving.&nbsp;&nbsp; It's always best to use an absolute URI (that
includes a scheme, e.g., platform:/resource/project/abc.xml) so that
references to other resources can be made relative.&nbsp; In this case the
references look to be in the same resource too so maybe one of these
defects is related:<br>
<blockquote><a
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=218759">https://bugs.eclipse.org/bugs/show_bug.cgi?id=218759</a><br>
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=196495">https://bugs.eclipse.org/bugs/show_bug.cgi?id=196495</a><br>
</blockquote>
Which version of EMF are you using?<br>
<blockquote cite="mid:ft5t7f$o1i$1@build.eclipse.org" type="cite">
<pre wrap="">"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:merks@ca.ibm.com">&lt;merks@ca.ibm.com&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:ft5rv9$1ed$1@build.eclipse.org">news:ft5rv9$1ed$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Daniel,

It's a little hard to comment without knowing the model. Both
predecessors and outputs point at the same object, but only the one
feature has the duplication problem. Are these two features defined
differently in some way? Are the bidirectional? What's the full URI of
the resource that contains the XMI serialization you show below.


Daniel Tuohy wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hello,

I'm seeing a problem when loading an object from a resource. For one
particular multi-valued reference for a particular type of contained
object, I am getting extraneous null references. They aren't missing,
they just shouldn't be there in the first place. The xml in the resource
(in the file test_schedule.xml) for an example object looks like this:

&lt;tasks xmi:id="_mppFoQJKEd2xG_FIPUDu1w" name="task1"
cost="50000" duration="60"
system="domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"
actualStart="2007-09-08T21:53:20.000-0400"
actualEnd="2007-11-07T21:53:20.000-0500"
predecessors="test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
outputs="test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"
resourceConflicts="domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w "&gt;
&lt;/tasks&gt;

Note that there is only one value in "predecessor". When I load from
this resource, the first predecessor is a "null"-valued Task, and the
second is the correct filler. If I immediately save the resource, the
same object looks like this (note the now duplicated reference in
'predecessors').

&lt;tasks xmi:id="_mppFoQJKEd2xG_FIPUDu1w" name="task1"
cost="50000" duration="60"
system="domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"
actualStart="2007-09-08T21:53:20.000-0400"
actualEnd="2007-11-07T21:53:20.000-0500"
predecessors="test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w
test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
outputs="test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"
resourceConflicts="domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w "&gt;
&lt;/tasks&gt;

The code I used for loading from the XML resource, inspecting the object
in the debugger, then saving the resource is these three lines:
resourceModelLoad.load( null );

Schedule loadedModel = (Schedule)resourceModelLoad.getContents().get(0);

resourceModelLoad.save(System.out,null);

Any idea what might be causing this?

Daniel



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

</pre>
</blockquote>
<br>
</body>
</html>

--------------060707050306000907050809--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Loaded list reference contains extraneous "null references" [message #418202 is a reply to message #418200] Fri, 04 April 2008 19:39 Go to previous message
Daniel Tuohy is currently offline Daniel TuohyFriend
Messages: 41
Registered: July 2009
Member
This is a multi-part message in MIME format.

------=_NextPart_000_0157_01C8966A.1B9AF8E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Thanks for the tip - I'll look into specifying full URIs. I'm using EMF =
2.3.1.

"Ed Merks" <merks@ca.ibm.com> wrote in message =
news:ft5ver$jn2$1@build.eclipse.org...
Daniel,

Comments below.

Daniel Tuohy wrote:=20
Hi Ed,

Note that "outputs" and "predecessors" don't actually point to the same=20
object, the IDs are different. Sorry, these darned things are a bit of =
a eye chart.

However, "outputs" and "predecessors" are=20
EOpposites of each other, although both are identically specified in the =

Ecore model other than their names.That was my suspicion.

I would also note that they are of the=20
same type (Task). So if Task B has Task A as a predecessor, then Task A =
has=20
Task B as an output.

The URI of the resource is "test_schedule.xml" (it contains all the Task =

objects, there are no cross-document references).
The problem is maybe caused by the use of a relative URI for doing the =
loading and saving. It's always best to use an absolute URI (that =
includes a scheme, e.g., platform:/resource/project/abc.xml) so that =
references to other resources can be made relative. In this case the =
references look to be in the same resource too so maybe one of these =
defects is related:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D218759
https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D196495

Which version of EMF are you using?

"Ed Merks" <merks@ca.ibm.com> wrote in message=20
news:ft5rv9$1ed$1@build.eclipse.org...
Daniel,

It's a little hard to comment without knowing the model. Both=20
predecessors and outputs point at the same object, but only the one=20
feature has the duplication problem. Are these two features defined=20
differently in some way? Are the bidirectional? What's the full URI of =

the resource that contains the XMI serialization you show below.


Daniel Tuohy wrote:
Hello,

I'm seeing a problem when loading an object from a resource. For one=20
particular multi-valued reference for a particular type of contained=20
object, I am getting extraneous null references. They aren't missing,=20
they just shouldn't be there in the first place. The xml in the =
resource=20
(in the file test_schedule.xml) for an example object looks like this:

<tasks xmi:id=3D"_mppFoQJKEd2xG_FIPUDu1w" name=3D"task1"
cost=3D"50000" duration=3D"60"=20
system=3D"domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"=20
actualStart=3D"2007-09-08T21:53:20.000-0400"
actualEnd=3D"2007-11-07T21:53:20.000-0500"=20
predecessors=3D"test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
outputs=3D"test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"=20
resourceConflicts=3D"domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w ">
</tasks>

Note that there is only one value in "predecessor". When I load from=20
this resource, the first predecessor is a "null"-valued Task, and the=20
second is the correct filler. If I immediately save the resource, the=20
same object looks like this (note the now duplicated reference in=20
'predecessors').

<tasks xmi:id=3D"_mppFoQJKEd2xG_FIPUDu1w" name=3D"task1"
cost=3D"50000" duration=3D"60"=20
system=3D"domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"=20
actualStart=3D"2007-09-08T21:53:20.000-0400"
actualEnd=3D"2007-11-07T21:53:20.000-0500"=20
predecessors=3D"test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w=20
test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
outputs=3D"test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"=20
resourceConflicts=3D"domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w ">
</tasks>

The code I used for loading from the XML resource, inspecting the object =

in the debugger, then saving the resource is these three lines:
resourceModelLoad.load( null );

Schedule loadedModel =3D =
(Schedule)resourceModelLoad.getContents().get(0);

resourceModelLoad.save(System.out,null);

Any idea what might be causing this?

Daniel



=20

=20

------=_NextPart_000_0157_01C8966A.1B9AF8E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.6000.16608" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Thanks for the tip - I'll look into =
specifying full=20
URIs.&nbsp; I'm using&nbsp;EMF 2.3.1.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:ft5ver$jn2$1@build.eclipse.org">news:ft5ver$jn2$1@build.ecli=
pse.org</A>...</DIV>Daniel,<BR><BR>Comments=20
below.<BR><BR>Daniel Tuohy wrote:=20
<BLOCKQUOTE cite=3Dmid:ft5t7f$o1i$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Hi Ed,

Note that "outputs" and "predecessors" don't actually point to the same=20
object, the IDs are different. </PRE></BLOCKQUOTE>Sorry, these darned =
things=20
are a bit of a eye chart.<BR>
<BLOCKQUOTE cite=3Dmid:ft5t7f$o1i$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">However, "outputs" and "predecessors" are=20
EOpposites of each other, although both are identically specified in the =

Ecore model other than their names.</PRE></BLOCKQUOTE>That was my=20
suspicion.<BR>
<BLOCKQUOTE cite=3Dmid:ft5t7f$o1i$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D""> I would also note that they are of the=20
same type (Task). So if Task B has Task A as a predecessor, then Task A =
has=20
Task B as an output.

The URI of the resource is "test_schedule.xml" (it contains all the Task =

objects, there are no cross-document references).
</PRE></BLOCKQUOTE>The problem is maybe caused by the use of a =
relative URI=20
for doing the loading and saving.&nbsp;&nbsp; It's always best to use =
an=20
absolute URI (that includes a scheme, e.g.,=20
platform:/resource/project/abc.xml) so that references to other =
resources can=20
be made relative.&nbsp; In this case the references look to be in the =
same=20
resource too so maybe one of these defects is related:<BR>
<BLOCKQUOTE><A=20
=
href=3D"https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D218759">https://b=
ugs.eclipse.org/bugs/show_bug.cgi?id=3D218759</A><BR><A=20
=
href=3D"https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D196495">https://b=
ugs.eclipse.org/bugs/show_bug.cgi?id=3D196495</A><BR></BLOCKQUOTE >Which=20
version of EMF are you using?<BR>
<BLOCKQUOTE cite=3Dmid:ft5t7f$o1i$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:merks@ca.ibm.com">&lt;merks@ca.ibm.com&gt;</A> wrote in =
message=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:ft5rv9$1ed$1@build.eclipse.org">news:ft5rv9$1ed$1@build.ecli=
pse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Daniel,

It's a little hard to comment without knowing the model. Both=20
predecessors and outputs point at the same object, but only the one=20
feature has the duplication problem. Are these two features defined=20
differently in some way? Are the bidirectional? What's the full URI of =

the resource that contains the XMI serialization you show below.


Daniel Tuohy wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Hello,

I'm seeing a problem when loading an object from a resource. For one=20
particular multi-valued reference for a particular type of contained=20
object, I am getting extraneous null references. They aren't missing,=20
they just shouldn't be there in the first place. The xml in the =
resource=20
(in the file test_schedule.xml) for an example object looks like this:

&lt;tasks xmi:id=3D"_mppFoQJKEd2xG_FIPUDu1w" name=3D"task1"
cost=3D"50000" duration=3D"60"=20
system=3D"domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"=20
actualStart=3D"2007-09-08T21:53:20.000-0400"
actualEnd=3D"2007-11-07T21:53:20.000-0500"=20
predecessors=3D"test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
outputs=3D"test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"=20
resourceConflicts=3D"domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w "&gt;
&lt;/tasks&gt;

Note that there is only one value in "predecessor". When I load from=20
this resource, the first predecessor is a "null"-valued Task, and the=20
second is the correct filler. If I immediately save the resource, the=20
same object looks like this (note the now duplicated reference in=20
'predecessors').

&lt;tasks xmi:id=3D"_mppFoQJKEd2xG_FIPUDu1w" name=3D"task1"
cost=3D"50000" duration=3D"60"=20
system=3D"domain_model.xml#_jOAF6QJKEd2xG_FIPUDu1w"=20
actualStart=3D"2007-09-08T21:53:20.000-0400"
actualEnd=3D"2007-11-07T21:53:20.000-0500"=20
predecessors=3D"test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w=20
test_schedule.xml#_mppFqwJKEd2xG_FIPUDu1w"
outputs=3D"test_schedule.xml#_mppFswJKEd2xG_FIPUDu1w"=20
resourceConflicts=3D"domain_model.xml#_jhN8pQJKEd2xG_FIPUDu1w "&gt;
&lt;/tasks&gt;

The code I used for loading from the XML resource, inspecting the object =

in the debugger, then saving the resource is these three lines:
resourceModelLoad.load( null );

Schedule loadedModel =3D =
(Schedule)resourceModelLoad.getContents().get(0);

resourceModelLoad.save(System.out,null);

Any idea what might be causing this?

Daniel



</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->

</PRE></BLOCKQUOTE><BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0157_01C8966A.1B9AF8E0--
Previous Topic:Model integrity validation / Fatal error severity
Next Topic:Not able to set EType in EMF 2.4.0.v200803181800
Goto Forum:
  


Current Time: Fri Apr 19 00:03:39 GMT 2024

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

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

Back to the top