Skip to main content



      Home
Home » Modeling » QVT-OML » Modified parameter 'self' is input only
Modified parameter 'self' is input only [message #1715287] Fri, 20 November 2015 19:16 Go to next message
Eclipse UserFriend
Hi Guys

I am exercising with qvto and not sure why qvto editor reports "Modified parameter 'self' is input only" for
self.eAnnotations += object ECORE::EAnnotation{ source :=annsource;};
in
helper ECORE::EModelElement::getOrCreateEAnnForSource(in annsource: String): EAnnotation {
var eann: ECORE::EAnnotation := self.getEAnnotation(annsource);
if(eann=null){
self.eAnnotations += object ECORE::EAnnotation{ source :=annsource;};
};
return eann;
}
My expectation was that it is possible to modify self content in helper (...but not in query?). Am I missing something?

Thanks
Michael

[Updated on: Sat, 21 November 2015 13:04] by Moderator

Re: Modified parameter 'self' is input only [message #1715422 is a reply to message #1715287] Mon, 23 November 2015 08:44 Go to previous message
Eclipse UserFriend
Hi

The 'self' parameter is read-only by default. An explicit 'inout' declaration should do the trick, but Eclipse QVTo seems to support that only for mappings, not for helpers.

helper inout ECORE::EModelElement::getOrCreateEAnnForSource(in annsource: String): EAnnotation {...} 


Instead, try converting your helper to a mapping, or pass the EModelElement as a trailing parameter.


Regards
Christopher
Previous Topic:Tracing QVT interpreter
Next Topic:Run multiple transformations in parallel
Goto Forum:
  


Current Time: Sun Jul 27 16:32:48 EDT 2025

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

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

Back to the top