Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How to programmtically be notified when an element in a sumodel have been manually loaded/resolved.
How to programmtically be notified when an element in a sumodel have been manually loaded/resolved. [message #1786378] Wed, 02 May 2018 10:07 Go to next message
Thomas Wiman is currently offline Thomas WimanFriend
Messages: 35
Registered: June 2012
Location: Stockholm , Sweden
Member

I am trying to be notified when an element in a submodel is being loaded manually using the context menu entry "Load" in Model Explorer view.

I have added a ResourceSetListener without any filter to the editing domain. This listener is notified when an element is being loaded. But at the time for notification, the element to be loaded does not seems to have been completely resolved as the Owner reference is not yet set, e.g. the method element.getOwner() returns null.

Is there an alternative for how to get notification when an element in a submodel is loaded at the time where it has been completely resolved including the owner reference being set?

/Thomas
Re: How to programmtically be notified when an element in a sumodel have been manually loaded/resolv [message #1786381 is a reply to message #1786378] Wed, 02 May 2018 12:01 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1176
Registered: July 2009
Location: Canada
Senior Member

Hi, Thomas,

I think this probably indicates a bug in Papyrus. The command that loads a sub-model unit should perform that in a transaction (a read-only transaction would suffice), so that all notifications to ResourceSetListeners will be batched until after the entire operation has completed, including the resolution of that containment proxy that sets up the linkage to the parent model unit. The reason why you're getting notification of the sub-model resource being loaded before the connection to the parent is made is because in the absence of the transaction context, every notification from the EMF run-time is dispatched individually to listeners.

I don't know of any other mechanism by which you can be notified that sub-models are being loaded, unless perhaps there's something in the Eclipse Command Handlers framework that can notify you about command execution (as from the menu action).

Cheers,
Christian
Re: How to programmtically be notified when an element in a sumodel have been manually loaded/resolv [message #1786382 is a reply to message #1786381] Wed, 02 May 2018 12:28 Go to previous messageGo to next message
Thomas Wiman is currently offline Thomas WimanFriend
Messages: 35
Registered: June 2012
Location: Stockholm , Sweden
Member

Thanks Christian for a quick answer. Unfortunately it was not the answer I wanted. I will try to figure out an alternative solution for my need. Should I register it as a bug in Bugzilla?

/Thomas


Thomas Wiman
MetaModelAgent Product Manager
Re: How to programmtically be notified when an element in a sumodel have been manually loaded/resolv [message #1786399 is a reply to message #1786382] Wed, 02 May 2018 16:03 Go to previous message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1176
Registered: July 2009
Location: Canada
Senior Member

Hi, Thomas,

Yeah, sorry, not a great answer. Please do raise a bug. And if you can contribute a patch, so much the better! It will be useful for listeners to get notified after the fact.

cW
Previous Topic:[SysML] Where are the getX operations on stereotypes of the SysML profile implemented?
Next Topic:Improve FunctionBehavior editor?
Goto Forum:
  


Current Time: Mon Nov 19 12:19:28 GMT 2018

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

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

Back to the top