Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] Inline Object Creation(Creating attributes for classes usign inline object creation)
[QVTO] Inline Object Creation [message #533898] Mon, 17 May 2010 12:40 Go to next message
Siegfried Nolte is currently offline Siegfried NolteFriend
Messages: 48
Registered: August 2009
Member
Hi QVTO-folks,

there is something wrong with the following mapping resulting in different syntactical errors with respect to the "object (p) ... "construction :

mapping Class::transformClassesWithInlineObject () : Class
{
name := self.name;
ownedAttribute := self.ownedAttribute->object (p) Property
{
name := p.name;
};
}

I took this from a similar sample of the specification (p49 - inline mapping). Maybe I should take

ownedAttribute += self.ownedAttribute->object (p) Property
{
name := p.name;
};

but that doesn't work either. And yes, I know, I can do this sample with a mapping as well, but I need a bit of help with inline mapping.

By the way, I'm working with the Galileo version of QVTO, and the metamodel is UML2.

Thanks,
Siegfried

[Updated on: Mon, 17 May 2010 12:41]

Report message to a moderator

Re: [QVTO] Inline Object Creation [message #534111 is a reply to message #533898] Tue, 18 May 2010 06:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dhendriksREMOVE_THIS.tueREMOVE.THIS.nl

Siegfried wrote:
> Hi QVTO-folks,
>
> there is something wrong with the following mapping resulting in
> different syntactical errors with respect to the "object (p) ...
> "construction :
>
> mapping Class::transformClassesWithInlineObject () : Class
> {
> name := self.name;
> ownedAttribute := self.ownedAttribute->object (p) Property {
> name := p.name;
> }; }
>
> I took this from a similar sample of the specification (p49 - inline
> mapping). Maybe I should take
> ownedAttribute += self.ownedAttribute->object (p) Property {
> name := p.name;
> };
> but that doesn't work either. And yes, I know, I can do this sample with
> a mapping as well, but I need a bit of help with inline mapping.
> By the way, I'm working with the Galileo version of QVTO.
> Thanks, Siegfried

Hello Siegfried,

Maybe you can write it like this:

....
ownedAttribute := self.ownedAttribute
->collect(p | object Property { name := p.name; });
...

Hope this helps,
Dennis
Re: [QVTO] Inline Object Creation [message #534538 is a reply to message #534111] Wed, 19 May 2010 13:15 Go to previous messageGo to next message
Siegfried Nolte is currently offline Siegfried NolteFriend
Messages: 48
Registered: August 2009
Member
Hello Dennis and thanks,

yes, it helps, as OCL constructions often do when QVT doesn't. Though I would like to stay near to the specification example (p.49 below) and as far as I can see, this sample doesn't work with QVT-O, does it?

Siegfried
Re: [QVTO] Inline Object Creation [message #534821 is a reply to message #534538] Thu, 20 May 2010 12:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dhendriksREMOVE_THIS.tueREMOVE.THIS.nl

Hello Siegfried,

> yes, it helps, as OCL constructions often do when QVT doesn't. Though I
> would like to stay near to the specification example (p.49 below)

I couldn't find this on page 49 (of this document:
http://www.omg.org/spec/QVT/1.0/PDF/)...

But if an example from the official specification doesn't work, I think
you should definitely file a bug report.


> far as I can see, this sample doesn't work with QVT-O, does it?

I only know QVTo. The line I proposed:

ownedAttribute := self.ownedAttribute
->collect(p | object Property { name := p.name; });

should work in Qvto, I think. That is, you should put it inside a
mapping, obviously. Why do you think it doesn't work in QVTo?

Dennis
Re: [QVTO] Inline Object Creation [message #534887 is a reply to message #534821] Thu, 20 May 2010 14:53 Go to previous messageGo to next message
Siegfried Nolte is currently offline Siegfried NolteFriend
Messages: 48
Registered: August 2009
Member
Hello Dennis,

sorry, you are right, it's page 51, chapter 8.1.6, the 2nd code sample describing inline mapping. There you can find

column := self.attribute->object(a) Column
{
   name=a.name; 
   ...
};


This doesn't work with my QVTO (2.0.0). I'm preparing a QVT workshop and so I want to be near to the Spec.

The OCL collect sample works fine and it does the job, so I wasn't going to post a bug.

Best wishes,
Siegfried
Re: [QVTO] Inline Object Creation [message #534908 is a reply to message #534887] Thu, 20 May 2010 15:37 Go to previous message
Eclipse UserFriend
Originally posted by: dhendriksREMOVE_THIS.tueREMOVE.THIS.nl

Siegfried wrote:
> Hello Dennis,
>
> sorry, you are right, it's page 51, chapter 8.1.6, the 2nd code sample
> describing inline mapping. There you can find
> column := self.attribute->object(a) Column
> {
> name=a.name; ...
> };
>
> This doesn't work with my QVTO (2.0.0). I'm preparing a QVT workshop and
> so I want to be near to the Spec.
> The OCL collect sample works fine and it does the job, so I wasn't going
> to post a bug.
> Best wishes,
> Siegfried
>

Hello Siegfried,

if something doesn't work as it should a bugzilla should always be
created, to make sure that it will work at some point in the future. If
you tried to use it, other people will as well. By creating the bugzilla
you help the entire community in getting a better product...

Best wishes,
Dennis
Previous Topic:[ATL]An internal error
Next Topic:while
Goto Forum:
  


Current Time: Thu Mar 28 23:48:07 GMT 2024

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

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

Back to the top