Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » CanonicalEditPolicy and persistedChildren vs. transientChildren
CanonicalEditPolicy and persistedChildren vs. transientChildren [message #548640] Thu, 22 July 2010 14:21 Go to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 333
Registered: July 2009
Senior Member
Dear GMF folks,

we encountered a strange behavior of a GMF editor of ours which we think
is a GMF bug:

1. Create an empty diagram
2. Make changes to the semantic model
-> the canonical edit policy correctly adds views for new elements
3. save
4. re-open the diagram

Then we get a
"IRJS0007E Semantic refresh failed."

Looking at the serialized notation model, we find that some of the
Shapes that should be there haven't been serialized and hence some of
the connections do not find their source and target Shapes.

Debugging the issue reveals that the canonical edit policy seems to
create all necessary views, BUT it puts some of them in the containment
tree as "persistedChildren" and the missing ones as "transientChildren",
which do not get serialized when saving.

Are issues like this known? Why can it happen that some views are put
into the tree as transient??

We treat all semantic objects the same. We created them within one
single model-to-model transformation using Xtend.

Any hints?

Cheers,
Hauke
Re: CanonicalEditPolicy and persistedChildren vs. transientChildren [message #548899 is a reply to message #548640] Fri, 23 July 2010 12:19 Go to previous messageGo to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 333
Registered: July 2009
Senior Member
Maybe this could be the problem:
http://dev.eclipse.org/mhonarc/lists/gmf-dev/msg01601.html

After creating of new views, they are made immutable. Why??

/**
* Sets views as being immutable, meaning that they are unmodifiable as
* non-persisted views. Any subsequent change to an immutable view
* will force
* the view to be persisted.
*
* @param createdViews <code<>List</code> of view adapters that were
* created during the
* {@link CanonicalEditPolicy#refreshSemantic()} operation
*/
final protected void makeViewsImmutable(List<IAdaptable> createdViews) {
if (createdViews != null && !createdViews.isEmpty()) {
addListenersToContainers(createdViews);
List<IAdaptable> viewAdapters = prepareAdapterList(createdViews);
Command immutable =
SetViewMutabilityCommand.makeImmutable(viewAdapters);
AsyncCommand ac = new AsyncCommand(immutable);
ac.execute();
}
}

It looks like after setting something to immutable, you need to change
it again to become persitent.
And in fact that can be confirmed:

1. create model
2. manually move the not serialized parts
3. save, reload -> Everything is fine!

So it seems like the initial layout is done before the immutable action
is asynchronously executed...
One question would be why new views are marked immutable at all after
creation..
Anyone knows?

Cheers,
Hauke
Re: CanonicalEditPolicy and persistedChildren vs. transientChildren [message #549644 is a reply to message #548899] Tue, 27 July 2010 13:05 Go to previous message
SonglinPiao  is currently offline SonglinPiao Friend
Messages: 11
Registered: December 2009
Junior Member
you can check inside ecore file that if you set the containment property to true. If not, it means the child reference may not be well serialized.
I wish this could help you.
Previous Topic:Problem with linking two elements
Next Topic:Link mapping source and target feature problem
Goto Forum:
  


Current Time: Sat May 18 16:34:41 GMT 2024

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

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

Back to the top