Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Strange behaviour after saving
Strange behaviour after saving [message #1240186] Wed, 05 February 2014 22:27 Go to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Hi,

I observed something strange in my custom editorpart, after using the emf save mechanism (strg+s). Before I use saving, everything works fine, but after saving it seems that attributes are not updated anymore, which breaks further methods. For this reason I printed out the object, which gave something interesting.

That's the object before I save, whcih is pretty fine so far:

pld.impl.VariationpointImpl@598a6f (name: Ethernetshild, description: <unset>, configStatus: Selected)


After saving, Iget the following message, which I don't really understand, but it seems to break my other functionality, as the editor don't get attributes changes anymore:
pld.impl.VariationpointImpl@c517f4 (eProxyURI: platform:/resource/test/default.pld#_1OUj8IgeEeOXj_Il_6BA_w)


Can someone tell me what the eProxyURI stuff means and why it is there?

Cheers,
Phil
Re: Strange behaviour after saving [message #1240971 is a reply to message #1240186] Fri, 07 February 2014 09:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Phil,

Comments below.

On 05/02/2014 11:27 PM, Phil H wrote:
> Hi,
>
> I observed something strange in my custom editorpart, after using the
> emf save mechanism (strg+s). Before I use saving, everything works
> fine, but after saving it seems that attributes are not updated
> anymore, which breaks further methods. For this reason I printed out
> the object, which gave something interesting.
>
> That's the object before I save, whcih is pretty fine so far:
>
>
> pld.impl.VariationpointImpl@598a6f (name: Ethernetshild, description:
> <unset>, configStatus: Selected)
>
>
> After saving, Iget the following message, which I don't really
> understand, but it seems to break my other functionality, as the
> editor don't get attributes changes anymore:
>
> pld.impl.VariationpointImpl@c517f4 (eProxyURI:
> platform:/resource/test/default.pld#_1OUj8IgeEeOXj_Il_6BA_w)
>
>
> Can someone tell me what the eProxyURI stuff means and why it is there?
Saving won't convert an object to a proxy. So do you mean you have this
problem after loading the saved model?
>
> Cheers,
> Phil


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Strange behaviour after saving [message #1241044 is a reply to message #1240971] Fri, 07 February 2014 11:46 Go to previous messageGo to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Hmm not sure at all what you mean by loading the model. I just use the save mechanism and when I afterwards change the attribute of the Variationpoint using SetCommand and print it out, I get the proxy stuff. The result is that attribute changes during the SetCommand are not applied anymore, which is pretty bad.

Without using saving, everything works fine, so the saving mechanism seems to break my editor.
Re: Strange behaviour after saving [message #1241081 is a reply to message #1241044] Fri, 07 February 2014 13:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Phil,

Comments below.

On 07/02/2014 12:46 PM, Phil H wrote:
> Hmm not sure at all what you mean by loading the model.
Opening an editor loads the model...
> I just use the save mechanism and when I afterwards change the
> attribute of the Variationpoint using SetCommand and print it out, I
> get the proxy stuff. The result is that attribute changes during the
> SetCommand are not applied anymore, which is pretty bad.
>
> Without using saving, everything works fine, so the saving mechanism
> seems to break my editor.
Saving will not convert objects to proxies, so I it's hard to come up
with a theory about how such a problem might arise. You might set a
breakpoint in handleChangedResources and see is something is causing a
resource to be unloaded; that shouldn't normally happen but who knows
what you've all specialized in the normal generated code that might lead
to problems...


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Strange behaviour after saving [message #1260399 is a reply to message #1241081] Sat, 01 March 2014 12:15 Go to previous messageGo to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Hi Ed, sry for the late response.

I've set a breakpoint to handleChangedResources, but it seems that it's never really called.

My editor is extended by several tabs, which represent the model in different ways. Every tab extends EditorPart, hitting saving will call
public void doSave(final IProgressMonitor progressMonitor)
of the XYEditor class.

Using the saving mechanism in one of the tabs give objects the eProxyURI (whatever this means).

Closing the editor and reopen it, solve this then and everything work, till I save again.

Just to clarify: When the eProxyURI is shown, it means that the model is unloaded?
If so, which methods could possibly responsible for this behaviour?

Cheers,
Phil
Re: Strange behaviour after saving [message #1260576 is a reply to message #1260399] Sat, 01 March 2014 16:57 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Phil,

Comments below.

On 01/03/2014 1:15 PM, Phil H wrote:
> Hi Ed, sry for the late response.
>
> I've set a breakpoint to handleChangedResources, but it seems that
> it's never really called.
That's strange.
>
> My editor is extended by several tabs, which represent the model in
> different ways. Every tab extends EditorPart, hitting saving will call
> public void doSave(final IProgressMonitor progressMonitor) of the
> XYEditor class.
>
> Using the saving mechanism in one of the tabs give objects the
> eProxyURI (whatever this means).
>
> Closing the editor and reopen it, solve this then and everything work,
> till I save again.
>
> Just to clarify: When the eProxyURI is shown, it means that the model
> is unloaded?
Yes.
> If so, which methods could possibly responsible for this behaviour?
Resource.unload, but the method that calls this in the generated editor
is handledChangedResources, which you say is never really called...
>
> Cheers,
> Phil


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Strange behaviour after saving [message #1263790 is a reply to message #1260576] Tue, 04 March 2014 19:44 Go to previous messageGo to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
So when I use the following code to check if the resource is loaded:

System.out.println(fm);
for(Resource res : getEditingDomain().getResourceSet().getResources()){
	System.out.println(res.isLoaded());
}


I get the following outline, which tells me that the resoure is loaded:

pld.impl.FeatureMImpl@7b8df466 (eProxyURI: platform:/resource/test/default.pld#_1ZhZQYgcEeOXj_Il_6BA_w)
true


Re: Strange behaviour after saving [message #1264963 is a reply to message #1263790] Wed, 05 March 2014 16:49 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Phil,

I can't say more than I already did. Clearly you're printing out
something that indicates you have a proxy and the debug prints you added
seem to indicate that nothing has attempted to resolve that proxy or
that the proxy can't resolve...


On 04/03/2014 8:44 PM, Phil H wrote:
> So when I use the following code to check if the resource is loaded:
>
>
> System.out.println(fm);
> for(Resource res : getEditingDomain().getResourceSet().getResources()){
> System.out.println(res.isLoaded());
> }
>
>
> I get the following outline, which tells me that the resoure is loaded:
>
> pld.impl.FeatureMImpl@7b8df466 (eProxyURI:
> platform:/resource/test/default.pld#_1ZhZQYgcEeOXj_Il_6BA_w)
> true
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EMF Resource Save issue
Next Topic:[XCORE] How to add an unique identifier
Goto Forum:
  


Current Time: Fri Apr 19 18:51:31 GMT 2024

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

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

Back to the top