EMF Query and EvaluationEnvironment [message #53439] |
Tue, 01 April 2008 14:53 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.15920 seconds