Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCLHelperPackage misses in 2.2 EMF/OCL
OCLHelperPackage misses in 2.2 EMF/OCL [message #35373] Mon, 06 August 2007 22:18 Go to next message
dorian_dinh is currently offline dorian_dinhFriend
Messages: 31
Registered: July 2009
Member
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 #35407 is a reply to message #35373] Tue, 07 August 2007 09:34 Go to previous messageGo to next message
dorian_dinh is currently offline dorian_dinhFriend
Messages: 31
Registered: July 2009
Member
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 #35441 is a reply to message #35373] Tue, 07 August 2007 16:39 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #35576 is a reply to message #35441] Wed, 08 August 2007 09:34 Go to previous messageGo to next message
dorian_dinh is currently offline dorian_dinhFriend
Messages: 31
Registered: July 2009
Member
I got this in here :

http://wiki.eclipse.org/CustomizingOclEnvironments
Re: OCLHelperPackage misses in 2.2 EMF/OCL [message #35609 is a reply to message #35576] Wed, 08 August 2007 19:05 Go to previous message
Eclipse UserFriend
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
Previous Topic:OCL, precondition of an operation
Next Topic:Please help me: Parse failed: ERROR in (packageDeclarationCS): (Unable to find package: ( uml))
Goto Forum:
  


Current Time: Tue Apr 23 10:46:03 GMT 2024

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

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

Back to the top