Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsRe: EMF + OCL
https://www.eclipse.org/forums/index.php/mv/msg/9486/29188/#msg_29188
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 ;-)
>]]>2007-06-21T10:40:14-00:00Re: EMF + OCL
https://www.eclipse.org/forums/index.php/mv/msg/9486/29264/#msg_29264
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 ;-)
>>]]>2007-06-21T10:54:53-00:00Re: EMF + OCL
https://www.eclipse.org/forums/index.php/mv/msg/9486/29378/#msg_29378
Originally posted by: fjlucas.um.es