Skip to main content



      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 03:56 Go to next message
Eclipse UserFriend
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 04:08 Go to previous messageGo to next message
Eclipse UserFriend
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 #1697187 is a reply to message #1697181] Tue, 02 June 2015 04:38 Go to previous messageGo to next message
Eclipse UserFriend
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 04:45 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Listen for profile application during import of RSA models [message #1697207 is a reply to message #1697181] Tue, 02 June 2015 08:56 Go to previous messageGo to next message
Eclipse UserFriend
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 09:55 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 13:47:24 EDT 2025

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

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

Back to the top