Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » "where" clause
"where" clause [message #997096] Thu, 03 January 2013 16:15 Go to next message
Fabio L. S. is currently offline Fabio L. S.Friend
Messages: 15
Registered: July 2010
Location: Brazil
Junior Member
I'm trying to use the "where" clause in a QVTo mapping, but I can't make it work. The word is highlighted as a correct token, but either the messages '"where" unexpected token(s)' or '"when" expected instead of "where"' appear.

A trivial example:

mapping UML::Package::example() : RDB::Schema
	where {
		result.name.size() > 4
	}
{
	result.name := self.name;
}


Am I doing something wrong?

Regards;


Fabio Levy Siqueira
Re: "where" clause [message #997101 is a reply to message #997096] Thu, 03 January 2013 16:52 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The QVTo spec defines

'when' as a pre-condition (more generally for QVTr, I prefer to call
this a co-condition)
'where' as a post-condition (I prefer to call this a corrolary, since it
does not affect the match)

The Simpleuml_To_Rdb.qvto demonstrates the use of 'when'

mapping UML::Class::persistentClass2table() : RDB::Table
when { self.isPersistent() }

and if you try to add a 'where' clause you get the error you report.

I think you want a 'when' anyway.

It seems that 'where' is not supported by Eclipse QVTo. Please raise a
Bugzilla.

Regards

Ed Willink

On 03/01/2013 16:15, Fabio L. S. wrote:
> I'm trying to use the "where" clause in a QVTo mapping, but I can't
> make it work. The word is highlighted as a correct token, but either
> the messages '"where" unexpected token(s)' or '"when" expected instead
> of "where"' appear.
> A trivial example:
>
>
> mapping UML::Package::example() : RDB::Schema
> where {
> result.name.size() > 4
> }
> {
> result.name := self.name;
> }
>
>
> Am I doing something wrong?
>
> Regards;
Re: "where" clause [message #997107 is a reply to message #997101] Thu, 03 January 2013 18:04 Go to previous message
Fabio L. S. is currently offline Fabio L. S.Friend
Messages: 15
Registered: July 2010
Location: Brazil
Junior Member
Hi Ed;

Yes, you are right. But I couldn't imagine a simple and yet interesting example for a "where" clause. That's why I used this example. (In fact, I'm not sure if this clause is really necessary for QVTo - differently from QVTd).

Nevertheless, thanks. I will raise a bug.

Regards;


Fabio Levy Siqueira
Previous Topic:For QVT-O EObject seems not to be supertype of EModelElement
Next Topic:Wrong execution order in inheriting mapping operations?
Goto Forum:
  


Current Time: Thu Apr 25 21:04:39 GMT 2024

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

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

Back to the top