Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Query Evaluate method
Query Evaluate method [message #728109] Thu, 22 September 2011 14:34 Go to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 3
Registered: September 2011
Junior Member
Hello All,

I'm using OCL to validate constrains over my own meta-models.

To do the evaluation of the constraint I invoke in my code the method "Evaluate" of the Query class. This evaluation has always worked fine till now...

My code remains the same, the only change is that now I'm using eclipse Indigo instead of Eclipse Helios (and indeed the associated OCL versions by default). The Evaluate method is returning "false" when it should return "true"... I have execute the same constraint in Eclipse helios and the result is "true".

Has anybody have the same problem?
I'm concerned about if the logic of the evaluation method may have change somehow...

Any clue about what may be happening?

Thanks in advance!!

Cheers
Re: Query Evaluate method [message #728119 is a reply to message #728109] Thu, 22 September 2011 14:59 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4187
Registered: July 2009
Senior Member
Hi Cristina

I presume that you're using the Ecore evaluator.

In principle nothing has changed. In practice a few bugs have been fixed
concerning null/invalid and unlimited.

One other user (https://bugs.eclipse.org/bugs/show_bug.cgi?id=347960)
has reported an issue with traversal over intermediate null features.
The evaluator now 'correctly' treats this as invalid and consequently
evaluates the entire traversal as invalid. You need
oclIsUndefined()/->notEmpty() guards analoguous to != null NPE guards in
Java.

I'm still considering raising an OMG issue to suggest making this more
friendly.

Regards

Ed Willink




On 22/09/2011 15:34, cristina.lopez wrote:
> Hello All,
>
> I'm using OCL to validate constrains over my own meta-models.
>
> To do the evaluation of the constraint I invoke in my code the method
> "Evaluate" of the Query class. This evaluation has always worked fine
> till now...
>
> My code remains the same, the only change is that now I'm using
> eclipse Indigo instead of Eclipse Helios (and indeed the associated
> OCL versions by default). The Evaluate method is returning "false"
> when it should return "true"... I have execute the same constraint in
> Eclipse helios and the result is "true".
>
> Has anybody have the same problem?
> I'm concerned about if the logic of the evaluation method may have
> change somehow...
>
> Any clue about what may be happening?
>
> Thanks in advance!!
>
> Cheers
Previous Topic:Ecore2OCLinEcore
Next Topic:Conversion between OCL datatypes and Ecore datatypes
Goto Forum:
  


Current Time: Fri Dec 19 08:39:17 GMT 2014

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

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