|
|
Re: OCLHelperPackage misses in 2.2 EMF/OCL [message #35441 is a reply to message #35373] |
Tue, 07 August 2007 16:39 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Dorian,
I don't recognize the name "OCLHelperPackage". This never existed in the
MDT OCL implementation.
This must be a package defined by your application or some other client of
the OCL API.
Cheers,
Christin
Dorian Dinh wrote:
> Good evening,
>
> My target platform is eclipse 3.2 which uses emf 2.2.
> I wish to custom my OCL evaluation environment so as to add some java
> helper functions. I base my work on the example available on the wiki.
> However, I encounter some api problems..
> What is the equivalent of "OCLHelperPackage" in EMF/OCL 2.2 ? An important
> refactoring seems to have been made on emf.ocl fwk, this class doesn't
> exist anymore. Can anyone lighten me ?
>
> (in the statement :
>
> private void init() {
> Variable vdcl = ExpressionsFactory.eINSTANCE.createVariable();
> vdcl.setName("help");
> vdcl.setType(TypeUtil.resolveType(this,
> OCLHelperPackage.eINSTANCE.getEClassifier("Helper")));
> this.addElement("help", vdcl, true);
> }
>
> )
>
> Thx forward
|
|
|
Re: OCLHelperPackage misses in 2.2 EMF/OCL [message #35475 is a reply to message #35407] |
Tue, 07 August 2007 16:42 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Dorian,
Have a look at the org.eclipse.emf.ocl.types.util.TypeUtil class, the
defineOperation(...) method. In the OCL 1.1 API, the additional attributes
and operations were attached directly to the EClassifiers that they
extended, rather than being maintained by the Environment.
HTH,
Christian
Dorian Dinh wrote:
> idem for the method Environment#addOperation(EClassifier type, EOperation
> operation), for defining an additional operation on OCL String. How could
> I express it in 2.2 ?
>
> Thx forward,
>
>
> Dorian.
|
|
|
|
Re: OCLHelperPackage misses in 2.2 EMF/OCL [message #35609 is a reply to message #35576] |
Wed, 08 August 2007 19:05 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Dorian,
I see. It looks like Chris pasted an actual working example from some
application he was developing. The OCLHelper package is undoubtedly an
EPackage that he defined to model some additional capabilities that his
application wanted to inject into the OCL environment.
The same technique would apply equally well in either the 1.0 or 1.1 API of
MDT OCL. His example was, actually, using the 1.0 API (as envident in the
EClassifier and other Ecore-centric terminology in the
AbstractEnvironmentFactory API, without generic type arguments).
Cheers,
Christian
Dorian Dinh wrote:
> I got this in here :
>
> http://wiki.eclipse.org/CustomizingOclEnvironments
|
|
|
Powered by
FUDForum. Page generated in 0.06338 seconds