Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] access to transformation properties
[QVTO] access to transformation properties [message #512635] Fri, 05 February 2010 17:32 Go to next message
Andrea  is currently offline Andrea Friend
Messages: 2
Registered: February 2010
Junior Member
Hi,

I'm writing a qvto script that exploits the import capability by access semantic.
I need to access to the non-intermediate contextual properties of the imported qvto scripts.
An imported script property is accessible from the instantiator except when it is inherited.

For example, let's define an imported script A.qvto and a script Main.qvto

-- A.qvto file
transformation A();
property info : String = '';
main() {
info := 'A';
}

-- Main.qvto file
import A;
transformation Main() access A;
main() {
var a := new A();
assert fatal(a.info='');
a.transform();
assert fatal(a.info='A');
}

It works fine in this case. Instead, it's not working in the following case.
Let's define a B.qvto as extension of A.qvto and modify Main.qvto.

-- B.qvto file
import A;
transformation B() extends A;
main() {
info := 'B';
}

-- Main.qvto file
import B;
transformation Main() access B;
main() {
var b := new B();
b.transform();
assert fatal(b.info='B');
}

Inherited property 'info' is accessible from B.qvto, but it is not accessible from Main.qvto.
Indeed, line "info := 'B'" works correctly and it is raised "Unrecognizable variable (info)" exception in line "assert fatal(b.info='B')".

Could the qvto engine be modified in order to access to inherited properties from the instantiator?
Thanks a lot!

Cheers,
Andrea
Re: [QVTO] access to transformation properties [message #513320 is a reply to message #512635] Tue, 09 February 2010 18:09 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Hi Andrea ,

It's indeed looks like a bug.

Could you please raise bugzilla on that?
https://bugs.eclipse.org/bugs/enter_bug.cgi?bug_status=NEW&a mp;component=QVT_OML-Engine&form_name=enter_bug&prod uct=M2M&version=2.0

Regards,
Sergey

Andrea wrote:
> Hi,
>
> I'm writing a qvto script that exploits the import capability by access
> semantic.
> I need to access to the non-intermediate contextual properties of the
> imported qvto scripts.
> An imported script property is accessible from the instantiator except
> when it is inherited.
>
> For example, let's define an imported script A.qvto and a script Main.qvto
>
> -- A.qvto file
> transformation A();
> property info : String = ''; main() {
> info := 'A';
> }
>
> -- Main.qvto file
> import A;
> transformation Main() access A;
> main() {
> var a := new A();
> assert fatal(a.info='');
> a.transform();
> assert fatal(a.info='A');
> }
>
> It works fine in this case. Instead, it's not working in the following
> case. Let's define a B.qvto as extension of A.qvto and modify Main.qvto.
>
> -- B.qvto file
> import A;
> transformation B() extends A;
> main() {
> info := 'B';
> }
>
> -- Main.qvto file
> import B;
> transformation Main() access B;
> main() {
> var b := new B();
> b.transform();
> assert fatal(b.info='B');
> }
>
> Inherited property 'info' is accessible from B.qvto, but it is not
> accessible from Main.qvto.
> Indeed, line "info := 'B'" works correctly and it is raised
> "Unrecognizable variable (info)" exception in line "assert
> fatal(b.info='B')".
>
> Could the qvto engine be modified in order to access to inherited
> properties from the instantiator?
> Thanks a lot!
>
> Cheers,
> Andrea
Re: [QVTO] access to transformation properties [message #513899 is a reply to message #513320] Thu, 11 February 2010 16:02 Go to previous message
Andrea  is currently offline Andrea Friend
Messages: 2
Registered: February 2010
Junior Member
Hi Sergey,

I've just open a bug report.
Thanks for your reply!

Best regards,
Andrea
Previous Topic:[QVTO] editor locks up when code assist box should show
Next Topic:[QVTO] reset metamodelregistry
Goto Forum:
  


Current Time: Fri Apr 26 00:02:50 GMT 2024

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

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

Back to the top