Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Re: EMF + OCL
Re: EMF + OCL [message #29188] Thu, 21 June 2007 10:40 Go to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Fran,

You should ask on the OCL newsgroup, which I've added to the "to" list
of the reply, and hence you can continue to use this thread.


Fran wrote:
> Firstly, sorry if this are not the place to post it :-)
>
> I'm starting to work with EMF and eclipse, and now I want to make a small plugin that can execute ocl constraints using the API provided by EMF.
>
> I have found this code and I have been making changes in order to get it works, but I have problems with Factory.eINSTANCE which is not recognized. The code is this:
>
> public void ocl() {
> Map extents = new HashMap();
>
> Query query=QueryFactory.eINSTANCE.createQuery("self.allConnections- >forAll(r1,r2|r1.name = r2.name implies r1 = r2)",LibraryPackage.eINSTANCE.getBook());
> Book myBook = Factory.eINSTANCE.createBook();
>
> Collection result=(Collection)query.evaluate(myBook);
> System.out.println(result);
> }
>
> If some of us have some example of this working, I would be grateful :-)
>
> Thanks a lot. Bye ;-)
>
Re: EMF + OCL [message #29264 is a reply to message #29188] Thu, 21 June 2007 10:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Fran,

"Factory.eINSTANCE" should be "EXTLibraryFactory.eINSTANCE"

This looks like a snippet from the OCL 1.0 tutorial. If you are using EMF
2.3 with Eclipse 3.3 (rather than EMF 2.2/Eclipse 3.2), then you should
probably be using the OCL 1.1 API. The on-line help documentation (the
OCL Developer Guide accessed by the "Help -> Help Contents" action in the
main menu bar) is vastly expanded, including an updated Tutorial, updated
Example, and lots of Programmer's Guide documentation.

For a working example of the OCL parser/interpreter, install the
Interactive OCL Console example plug-in in your workspace via the "File ->
New -> Example..." wizard (the "Interpreter Example" in the OCL category).

HTH,

Christian


Ed Merks wrote:

> Fran,

> You should ask on the OCL newsgroup, which I've added to the "to" list
> of the reply, and hence you can continue to use this thread.


> Fran wrote:
>> Firstly, sorry if this are not the place to post it :-)
>>
>> I'm starting to work with EMF and eclipse, and now I want to make a small
plugin that can execute ocl constraints using the API provided by EMF.
>>
>> I have found this code and I have been making changes in order to get it
works, but I have problems with Factory.eINSTANCE which is not recognized. The
code is this:
>>
>> public void ocl() {
>> Map extents = new HashMap();
>>
>> Query
query=QueryFactory.eINSTANCE.createQuery("self.allConnections- >forAll(r1,r2|r1.name
= r2.name implies r1 = r2)",LibraryPackage.eINSTANCE.getBook());
>> Book myBook = Factory.eINSTANCE.createBook();
>>
>> Collection result=(Collection)query.evaluate(myBook);
>> System.out.println(result);
>> }
>>
>> If some of us have some example of this working, I would be grateful :-)
>>
>> Thanks a lot. Bye ;-)
>>
Re: EMF + OCL [message #29378 is a reply to message #29264] Fri, 22 June 2007 08:24 Go to previous message
Eclipse UserFriend
Originally posted by: fjlucas.um.es

Thanks. I'll try it.
Previous Topic:stereotype's property
Next Topic:constraint's severity
Goto Forum:
  


Current Time: Tue Mar 19 03:35:51 GMT 2024

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

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

Back to the top