Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsQuery Evaluate method
https://www.eclipse.org/forums/index.php/mv/msg/241544/728109/#msg_728109
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]]>Missing name Missing name2011-09-22T14:34:57-00:00Re: Query Evaluate method
https://www.eclipse.org/forums/index.php/mv/msg/241544/728119/#msg_728119
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]]>Ed Willink2011-09-22T14:59:00-00:00