Re: EMF + OCL [message #29188] |
Thu, 21 June 2007 10:40 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 ;-)
>>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04493 seconds