Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » EMF Query and EvaluationEnvironment
EMF Query and EvaluationEnvironment [message #53439] Tue, 01 April 2008 14:53 Go to next message
Eclipse UserFriend
Originally posted by: x.maysonnave.gmail.com

Hi,

I'm implementing ocl variables support in our query facilities.

To start my implemenation I have followed this post :

http://www.eclipsepowered.org/eclipse/forums/t103864.html

Through EMF Validation I can successfully validate OCL statement with
variable support. To execute my queries I use EMF Query. I can build
EObjectCondition and feed the ocl environment of each condition with
variables definition.

However I cannot figure out how to feed variables value in the
EvaluationEnvironment as I use STATEMENT with WHERE clause. WHERE is
populated with EObjectCondition.

Is there a way to access the OCL EvaluationEnvironment from a STATEMENT or
there is another way to valuate ocl variables before executing any EMF
Query STATEMENT ?

Best Regards.
Re: EMF Query and EvaluationEnvironment [message #53466 is a reply to message #53439] Tue, 01 April 2008 15:38 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Xavier,

This is an EMF Query question, so I am including the EMF newsgroup in my
reply.

If you are not using "context-free" queries, then a subclass of
AbstractOCLCondition can obtain its Query object (from the OCL API) via the
protected getQuery() method. This Query provides access to the
EvaluationEnvironment, in which you can then bind the values of your
variables.

Note that this will have to be done on each individual condition object; the
statement has no knowledge of OCL dependencies.

The "context-free" queries add a wrinkle to the picture, because they
construct OCL Query objects on-the-fly for each metaclass in which context
they are applicable (i.e., can parse). For most purposes, you wouldn't
need these, anyway.

HTH,

Christian


Xavier Maysonnave wrote:

> Hi,
>
> I'm implementing ocl variables support in our query facilities.
>
> To start my implemenation I have followed this post :
>
> http://www.eclipsepowered.org/eclipse/forums/t103864.html
>
> Through EMF Validation I can successfully validate OCL statement with
> variable support. To execute my queries I use EMF Query. I can build
> EObjectCondition and feed the ocl environment of each condition with
> variables definition.
>
> However I cannot figure out how to feed variables value in the
> EvaluationEnvironment as I use STATEMENT with WHERE clause. WHERE is
> populated with EObjectCondition.
>
> Is there a way to access the OCL EvaluationEnvironment from a STATEMENT or
> there is another way to valuate ocl variables before executing any EMF
> Query STATEMENT ?
>
> Best Regards.
Previous Topic:[Announce] MDT OCL 1.2.0 I200803281715 is available
Next Topic:[Announce] MDT OCL 1.2.0M6 is available
Goto Forum:
  


Current Time: Fri Dec 27 02:56:19 GMT 2024

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

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

Back to the top