I have some trouble with some OCL expressions I want to evaluate using Pivot. For writing the expressions I am using the Xtext OCL console and I am ending up with a "Evaluation failure" I do not understand.
The problem -as far as I reduced it- originates from two nested exists where the inner tries to access the variable of the outer exists. Starting from an arbitrary ecore file I open the "Xtext OCL console" for a class with some attributes (for instance the Book class in extlibrary example) then I enter the following expression:
'NavigableObject' rather than 'Boolean' value required
presumably because the inner 'feature' reference has been resolved to
the Boolean inner 'data' rather than the Object outer 'feature'.
Regards
Ed Willink
On 12/05/2013 13:41, Bernhard Berger wrote:
> Hi,
>
> I have some trouble with some OCL expressions I want to evaluate using
> Pivot. For writing the expressions I am using the Xtext OCL console
> and I am ending up with a "Evaluation failure" I do not understand.
>
> The problem -as far as I reduced it- originates from two nested exists
> where the inner tries to access the variable of the outer exists.
> Starting from an arbitrary ecore file I open the "Xtext OCL console"
> for a class with some attributes (for instance the Book class in
> extlibrary example) then I enter the following expression:
>
> eStructuralFeatures->exists(feature | Set{true}->exists(data |
> feature.name = ''))
> The interpreter then prints:
> Evaluation failure
> Invalid source for '='
> The = is not related to the = in the expression. I'm aware that the
> code is semantically useless but the original query is longer.
>
> The "Interactice OCL console" returns a boolean value instead of
> throwing an error. Is it a bug in the Xtext OCL console
>
> Thanks in advance and regards,
> Bernhard