Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » Integrating OCL - providing EvaluationEnvironment
Integrating OCL - providing EvaluationEnvironment [message #88819] |
Tue, 10 July 2007 17:07 |
Eclipse User |
|
|
|
Originally posted by: jgreen.upb.de
Hi,
I'm trying to integrate OCL with another language where there are object patterns described that have to be matched in a
model. In my language, there are graph patterns and, during the matching, "nodes" are bound to model objects.
Now, I want to integrate OCL with that language. The problem is that I need to reuse the existing node bindings in OCL
expressions. For example, when a node "p" is bound to the object ":person", then I want to be able to evaluate
expressions like "p.name='John'". Or, suppose there are other "person" objects bound, "p1.name=p2.name" etc.
My guess is that I have to provide the existing node bindings to an EcoreEvaluationEnvironment (everything based on
ECore here). But, from there, I'm clueless how to proceed. Do I have to hand the EvaluationEnvironment the OCLHelper? How?
I haven't used the OCL API very much yet, so it would be great if someone could provide some explanation and code snippets.
Thanks a lot!
Joel
|
|
|
Re: Integrating OCL - providing EvaluationEnvironment [message #88834 is a reply to message #88819] |
Tue, 10 July 2007 18:14 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Joel,
Please use the MDT OCL newsgroup for OCL question (I have included it in
this reply).
Yes, that is correct. You will need to define custom "global" variables in
your Environment and provide values for them in your EvaluationEnvironment.
A complete example of how to do this can be found in the OCL Developer
Guide. In the Eclipse Help browser, select the
OCL Developer Guide
Programmer's Guide
Advanced Topics
Customizing the Environment
topic.
If that leaves you with unanswered questions, post them here!
HTH,
Christian
Joel Greenyer wrote:
> Hi,
> I'm trying to integrate OCL with another language where there are object
> patterns described that have to be matched in a model. In my language,
> there are graph patterns and, during the matching, "nodes" are bound to
> model objects. Now, I want to integrate OCL with that language. The
> problem is that I need to reuse the existing node bindings in OCL
> expressions. For example, when a node "p" is bound to the object
> ":person", then I want to be able to evaluate expressions like
> "p.name='John'". Or, suppose there are other "person" objects bound,
> "p1.name=p2.name" etc.
>
> My guess is that I have to provide the existing node bindings to an
> EcoreEvaluationEnvironment (everything based on ECore here). But, from
> there, I'm clueless how to proceed. Do I have to hand the
> EvaluationEnvironment the OCLHelper? How?
>
> I haven't used the OCL API very much yet, so it would be great if someone
> could provide some explanation and code snippets.
>
> Thanks a lot!
>
> Joel
|
|
|
Re: Integrating OCL - providing EvaluationEnvironment [message #88848 is a reply to message #88819] |
Tue, 10 July 2007 18:14 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Joel,
I'll redirect you to the OCL newsgroup which I've added to the "to" list
of this reply. Note that Christian has added some very nice help pages
that should be available via help when you install the SDK.
Joel Greenyer wrote:
> Hi,
> I'm trying to integrate OCL with another language where there are
> object patterns described that have to be matched in a model. In my
> language, there are graph patterns and, during the matching, "nodes"
> are bound to model objects.
> Now, I want to integrate OCL with that language. The problem is that I
> need to reuse the existing node bindings in OCL expressions. For
> example, when a node "p" is bound to the object ":person", then I want
> to be able to evaluate expressions like "p.name='John'". Or, suppose
> there are other "person" objects bound, "p1.name=p2.name" etc.
>
> My guess is that I have to provide the existing node bindings to an
> EcoreEvaluationEnvironment (everything based on ECore here). But, from
> there, I'm clueless how to proceed. Do I have to hand the
> EvaluationEnvironment the OCLHelper? How?
>
> I haven't used the OCL API very much yet, so it would be great if
> someone could provide some explanation and code snippets.
>
> Thanks a lot!
>
> Joel
|
|
|
Re: Integrating OCL - providing EvaluationEnvironment [message #608686 is a reply to message #88819] |
Tue, 10 July 2007 18:14 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Joel,
Please use the MDT OCL newsgroup for OCL question (I have included it in
this reply).
Yes, that is correct. You will need to define custom "global" variables in
your Environment and provide values for them in your EvaluationEnvironment.
A complete example of how to do this can be found in the OCL Developer
Guide. In the Eclipse Help browser, select the
OCL Developer Guide
Programmer's Guide
Advanced Topics
Customizing the Environment
topic.
If that leaves you with unanswered questions, post them here!
HTH,
Christian
Joel Greenyer wrote:
> Hi,
> I'm trying to integrate OCL with another language where there are object
> patterns described that have to be matched in a model. In my language,
> there are graph patterns and, during the matching, "nodes" are bound to
> model objects. Now, I want to integrate OCL with that language. The
> problem is that I need to reuse the existing node bindings in OCL
> expressions. For example, when a node "p" is bound to the object
> ":person", then I want to be able to evaluate expressions like
> "p.name='John'". Or, suppose there are other "person" objects bound,
> "p1.name=p2.name" etc.
>
> My guess is that I have to provide the existing node bindings to an
> EcoreEvaluationEnvironment (everything based on ECore here). But, from
> there, I'm clueless how to proceed. Do I have to hand the
> EvaluationEnvironment the OCLHelper? How?
>
> I haven't used the OCL API very much yet, so it would be great if someone
> could provide some explanation and code snippets.
>
> Thanks a lot!
>
> Joel
|
|
|
Re: Integrating OCL - providing EvaluationEnvironment [message #608687 is a reply to message #88819] |
Tue, 10 July 2007 18:14 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
Joel,
I'll redirect you to the OCL newsgroup which I've added to the "to" list
of this reply. Note that Christian has added some very nice help pages
that should be available via help when you install the SDK.
Joel Greenyer wrote:
> Hi,
> I'm trying to integrate OCL with another language where there are
> object patterns described that have to be matched in a model. In my
> language, there are graph patterns and, during the matching, "nodes"
> are bound to model objects.
> Now, I want to integrate OCL with that language. The problem is that I
> need to reuse the existing node bindings in OCL expressions. For
> example, when a node "p" is bound to the object ":person", then I want
> to be able to evaluate expressions like "p.name='John'". Or, suppose
> there are other "person" objects bound, "p1.name=p2.name" etc.
>
> My guess is that I have to provide the existing node bindings to an
> EcoreEvaluationEnvironment (everything based on ECore here). But, from
> there, I'm clueless how to proceed. Do I have to hand the
> EvaluationEnvironment the OCLHelper? How?
>
> I haven't used the OCL API very much yet, so it would be great if
> someone could provide some explanation and code snippets.
>
> Thanks a lot!
>
> Joel
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Thu Dec 26 14:57:15 GMT 2024
Powered by FUDForum. Page generated in 0.04973 seconds
|