Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » error in creating expression using EMF enumeration
error in creating expression using EMF enumeration [message #22007] Tue, 08 May 2007 21:38 Go to next message
Kagan Turgut is currently offline Kagan TurgutFriend
Messages: 12
Registered: July 2009
Junior Member
I am trying to create an OCL expression where the value can be anything
(i.e. an EObject, a primitive, an enumeration).

I get a Sematic exception (ERROR in (variableExpCS): (Unrecognized
variable: (ACTIVE))

when executing the following:

ExpressionsUtil.createQuery(environment, "ProductStatus.ACTIVE", true)

ProductStatus in an Enumeration where ACTIVE is one possible value.

Assuming that this API is the right API, Do I need to prepare the
"environment" to let it know about the enumerations?

kagan
Re: error in creating expression using EMF enumeration [message #22231 is a reply to message #22007] Wed, 09 May 2007 12:30 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Kagan,

No, you just need to use the OCL syntax for qualified names, which uses the
UML-style '::' separator instead of the Java-style '.':

ExpressionsUtil.createQuery(environment, "ProductStatus::ACTIVE", true);

OCL thought you were trying to access a static property named "ACTIVE" of
the ProductStatus classifier. :-)

Cheers,

Christian


Kagan Turgut wrote:

>
> I am trying to create an OCL expression where the value can be anything
> (i.e. an EObject, a primitive, an enumeration).
>
> I get a Sematic exception (ERROR in (variableExpCS): (Unrecognized
> variable: (ACTIVE))
>
> when executing the following:
>
> ExpressionsUtil.createQuery(environment, "ProductStatus.ACTIVE", true)
>
> ProductStatus in an Enumeration where ACTIVE is one possible value.
>
> Assuming that this API is the right API, Do I need to prepare the
> "environment" to let it know about the enumerations?
>
> kagan
Previous Topic:problem with parsing ocl expression in a standalone environment
Next Topic:Re: integrating ocl with emf
Goto Forum:
  


Current Time: Thu Apr 25 18:48:23 GMT 2024

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

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

Back to the top