[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] Re: [QVTO] Executing OCL queries

Hi Chris,

Comments inlined below.


thanks for your quick answer! Ok, so I guess there is no easy way around this problem, but I'm not willing to let go just yet ;)
Would it be possible as a workaround, e.g. to define kind of a pseudo-QVT transformation that in reality only executes the query

This is what I meant by involving QVT libraries and calling its helper operations
from OCL. For instance, you can define a library with a helper operation on a String:


library MyStrings;

helper String::echo() : String {
   return self;
}


Then you can write an expression using Essential OCL syntax, which can access the operation you have defined in your QVT library.

Something like:   self.echo() = self

The way how to enable QVT in your OCL expression is using a dedicated OCL
environment factory provided by QVTO, which can be initialised with
set of URIs referencing required QVT libraries and importing its operations into your
OCL.


Note, this example is simplistic to illustrate the concept, for sure you
can define complex queries on your models using the full QVT lang features.

(unfortunately my knowledge of QVT is very limited) or could the I-OCL interpreter be somehow "exported" as a separate plugin?


As I have mentioned, quite uncertain for this release cycle as we have limited resources
in our team and have other essential topics to solve ;(.


Regards,
/Radek


Regards,
Chris

radek dvorak wrote:

Hi Chris,

We do not support standalone Imperative OCL directly, so by using QVTO component
you can't parse and evaluate Imperative OCL expressions.

I agree that separation of this functionality seems natural and we definitely
are going to do some steps in this direction, just to get a cleaner design.
Anyway, it's unlikely that this will appear as API of QVTO in Helios.

What we do support is calling into QVT libraries from plain OCL, by using
a special OCL environment factory. It's possible to separate the
complex logic, which can be expressed more effectively in QVT queries and
reused in standard OCL expressions.

Currently, it's not part of the QVTO API, but we will expose this as API in
Helios, as it's pretty handy.

Regards,
/Radek



On Tue, 01 Sep 2009 16:55:15 +0200, C. Saad <christian.saad@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi everyone,

I'm using OCL to carry out some calculations on EMF models. This works quite well, however I'd like to replace essential OCL with imperative OCL because its additional expressions would enable the definition of more elaborate queries (but I don't need or want query-external side-effects nor any other QVT-related functionality).

Is there a way to easily switch from standard OCL to the imperative OCL implementation of the QVT project? I tried some things, e.g. replacing the environment factory...

OCL OCL_ENV = OCL.newInstance(QvtOperationalEnvFactory.INSTANCE);

..but unfortunately, without any success.

Any help would be highly appreciated :)

Regards,
Chris