Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Listen for profile application during import of RSA models
Listen for profile application during import of RSA models [message #1697176] Tue, 02 June 2015 07:56 Go to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
Hi,

I'd like to do some post processing when importing an RSA model and tried to use the ProfileApplicationListner as described http://www.eclipse.org/forums/index.php/t/1066844/

I've got it to work when I apply a profile from the GUI but when importing a model using the imported I'm not getting any ProfileApplicationNotification (but a massive amount of other notifications)





Re: Listen for profile application during import of RSA models [message #1697181 is a reply to message #1697176] Tue, 02 June 2015 08:08 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Patrik,

This is most likely because the Model Import tool does a lot of non-standard stuff, partly for performances, partly for convenience.

Especially, the profile/stereotype part is really ad-hoc and generally relies on QVTo/Ecore operations rather than UML ones, so the events might differ.

The transformation doesn't happen in a Papyrus ModelSet with a Papyrus ServicesRegistry. It uses a much lighter mechanism (Standard resource set, no services), so most Papyrus services don't even exist. I'm not sure whether the stereotype listener needs anything specific from Papyrus, or if it is designed to work with any resource set and UML model. Anyway, it might be dangerous to interact with the model import, because all transactions, read-only check, lazy resource loading... have been disabled to improve performances, which means that the whole operation can be very fragile when modified.

Camille


Camille Letavernier
Re: Listen for profile application during import of RSA models [message #1697187 is a reply to message #1697181] Tue, 02 June 2015 08:38 Go to previous messageGo to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
OK, I guessed it was something like that.

In any way, is it possible to get notified when the import is done so i can trigger my post processing?
Re: Listen for profile application during import of RSA models [message #1697189 is a reply to message #1697187] Tue, 02 June 2015 08:45 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi,

The Model Import tool doesn't provide any extension mechanism, but that's something which could be implemented. Since it happens in two phases, it's difficult to simply listen to the imported resources (They will be saved twice, and after the first save they might be in an inconsistent state)

Camille


Camille Letavernier
Re: Listen for profile application during import of RSA models [message #1697207 is a reply to message #1697181] Tue, 02 June 2015 12:56 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Indeed, the stereotype listener is a Papyrus Service, so the
notifications that it injects into the model won't be available during
the import transformation.

Cheers,

Christian


On 2015-06-02 08:08:34 +0000, Camille Letavernier said:

> Hi Patrik,
>
> This is most likely because the Model Import tool does a lot of
> non-standard stuff, partly for performances, partly for convenience.
>
> Especially, the profile/stereotype part is really ad-hoc and generally
> relies on QVTo/Ecore operations rather than UML ones, so the events
> might differ.
>
> The transformation doesn't happen in a Papyrus ModelSet with a Papyrus
> ServicesRegistry. It uses a much lighter mechanism (Standard resource
> set, no services), so most Papyrus services don't even exist. I'm not
> sure whether the stereotype listener needs anything specific from
> Papyrus, or if it is designed to work with any resource set and UML
> model. Anyway, it might be dangerous to interact with the model import,
> because all transactions, read-only check, lazy resource loading...
> have been disabled to improve performances, which means that the whole
> operation can be very fragile when modified.
>
> Camille
Re: Listen for profile application during import of RSA models [message #1697378 is a reply to message #1697207] Wed, 03 June 2015 13:55 Go to previous message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
I was hoping that I could be notified when everything is migrated/imported/saved (the second time)
Previous Topic:Communication Diagram
Next Topic:Getting matching elementTypes from eObject
Goto Forum:
  


Current Time: Thu Apr 18 18:18:00 GMT 2024

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

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

Back to the top