Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 499495

Summary: False validation errors in VSM with properties view description
Product: [Modeling] Sirius Reporter: Robert Doczi <robert.doczi>
Component: PropertiesAssignee: Project Inbox <sirius.properties-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: laurent.redor, pierre-charles.david, zoltan.ujhelyi
Version: 4.0.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows NT   
Whiteboard:

Description Robert Doczi CLA 2016-08-10 05:52:59 EDT
Most of the new variables in the aql expressions written for the new property view description cause validation errors: 

When defining an expression under Begin in Text/TextArea:
"The current context does not contains variable named: newValue"

When defining the Candidate Display Expression in a Radio Group / Select:
"Couldn't find the candidate variable"

When defining the value expression of a Text (and possibly all widgets):
"Feature xy not found in EClass EObject"

These are strictly validation errors as the defined property view works as intended in when opening a viewpoint.

This happened with both 4.0.0 and the latest nightly release 4.1.0.201608051602
Comment 1 Pierre-Charles David CLA 2016-08-10 07:55:55 EDT
Hi. Thanks for the report. This is a known limitation of the experimental version released with Sirius 4.0. It is being worked on as part of bug #496014, which is in progress. Hopefully I'll be able to merge at least partial support this week or the next. There may be some corner cases not yet fully supported in the first iteration, but the goal is to have good support for all expressions for the version which will be in Sirius 4.1.0.

I see you have tested a recent nightly. Would you be willing to give a shot on your own cases and give us feedback when the first patches are available in a nightly build?

*** This bug has been marked as a duplicate of bug 496014 ***
Comment 2 Robert Doczi CLA 2016-08-10 08:19:16 EDT
Sure, we will check it out.
Comment 3 Pierre-Charles David CLA 2016-08-10 09:24:51 EDT
(In reply to Robert Doczi from comment #2)
> Sure, we will check it out.

Thanks, I'll give you a pointer when we have a testable nightly.
Comment 4 Pierre-Charles David CLA 2016-08-23 03:18:26 EDT
(In reply to Robert Doczi from comment #2)
> Sure, we will check it out.

We've merge a first batch of changes, which should support most common cases, yesterday. If you're still OK to give it try, the latest nightly available at http://download.eclipse.org/sirius/updates/nightly/latest/neon contains the changes.

If you find any issue, please comment on bug 496014.

Thanks.
Comment 5 Pierre-Charles David CLA 2016-08-23 03:29:42 EDT
(In reply to Pierre-Charles David from comment #4)
> (In reply to Robert Doczi from comment #2)
> > Sure, we will check it out.
> 
> We've merge a first batch of changes, which should support most common
> cases, yesterday. If you're still OK to give it try, the latest nightly
> available at http://download.eclipse.org/sirius/updates/nightly/latest/neon
> contains the changes.

Oh, by the way, you'll also need the latest EEF nightly from http://download.eclipse.org/modeling/emft/eef/updates/nightly/latest/neon, as we've also merged some other changes (unrelated to this issue) which require it.
Comment 6 Zoltan Ujhelyi CLA 2016-08-23 12:22:48 EDT
I have tried out the current version, and I can report it is really much better; all the original issues are fixed in version 4.1.0.201608221602.

However, I got three instances of the error message 'Couldn't find the value variable' on Reference widgets I do not understand entirely. Furthermore, the editor/property sheet still seems to be working.

I am especially not sure whether I have to look for value or variable. Can the error message be enhanced by marking the identifiers provided by users, e.g. in apostrophes?
Comment 7 Pierre-Charles David CLA 2016-08-25 03:44:20 EDT
(In reply to Zoltan Ujhelyi from comment #6)
> I have tried out the current version, and I can report it is really much
> better; all the original issues are fixed in version 4.1.0.201608221602.

Thanks for the feedback!

> However, I got three instances of the error message 'Couldn't find the value
> variable' on Reference widgets I do not understand entirely. Furthermore,
> the editor/property sheet still seems to be working.

I think I've identified the origin of the message in AQL (the underlying query language); I've proposed a small improvement: https://git.eclipse.org/r/#/c/79696/

> I am especially not sure whether I have to look for value or variable.

It is looking for a variable named "value", that you have probably referenced in an expression, and the Sirius code does not declare it is available. It could be an issue in the completion/validation code, or in your expression.

Can you give the expression and where (in the Reference widget definition) it is defined?

> Can the error message be enhanced by marking the identifiers provided by users, e.g. in apostrophes?

See the above patch for the improvement in AQL. I'll have a quick look on the Sirius side to see if we have similar patterns that could be improved.
Comment 8 Zoltan Ujhelyi CLA 2016-08-25 05:23:13 EDT
(In reply to Pierre-Charles David from comment #7)
> (In reply to Zoltan Ujhelyi from comment #6)
> > I have tried out the current version, and I can report it is really much
> > better; all the original issues are fixed in version 4.1.0.201608221602.
> 
> Thanks for the feedback!
> 
> > However, I got three instances of the error message 'Couldn't find the value
> > variable' on Reference widgets I do not understand entirely. Furthermore,
> > the editor/property sheet still seems to be working.
> 
> I think I've identified the origin of the message in AQL (the underlying
> query language); I've proposed a small improvement:
> https://git.eclipse.org/r/#/c/79696/

Thanks, this looks very promising! I expressed this notion also in the review.

> > I am especially not sure whether I have to look for value or variable.
> 
> It is looking for a variable named "value", that you have probably
> referenced in an expression, and the Sirius code does not declare it is
> available. It could be an issue in the completion/validation code, or in
> your expression.
> 
> Can you give the expression and where (in the Reference widget definition)
> it is defined?
> 
Here is the related fragment of the .odesign file; where the message relates to the displayExpression attribute:

 <controls xsi:type="properties:ReferenceDescription" identifier="cps.ApplicationInstanceWithExpression.type" labelExpression="Type:" valueExpression="aql:self.type" displayExpression="aql:value.identifier">

       ...

</controls>

The Reference for the type seems to work as expected, but the odesign editor throws the aforementioned error message.
Comment 9 Pierre-Charles David CLA 2016-08-25 06:14:01 EDT
(In reply to Zoltan Ujhelyi from comment #8)
> Here is the related fragment of the .odesign file; where the message relates
> to the displayExpression attribute:
> 
>  <controls xsi:type="properties:ReferenceDescription"
> identifier="cps.ApplicationInstanceWithExpression.type"
> labelExpression="Type:" valueExpression="aql:self.type"
> displayExpression="aql:value.identifier">
> 
>        ...
> 
> </controls>

It looks like a bug on our side. I'll try to push a patch this afternoon. Thanks for catching this!
Comment 10 Pierre-Charles David CLA 2016-08-26 04:18:00 EDT
(In reply to Pierre-Charles David from comment #9)
> (In reply to Zoltan Ujhelyi from comment #8)
> > Here is the related fragment of the .odesign file; where the message relates
> > to the displayExpression attribute:
> > 
> >  <controls xsi:type="properties:ReferenceDescription"
> > identifier="cps.ApplicationInstanceWithExpression.type"
> > labelExpression="Type:" valueExpression="aql:self.type"
> > displayExpression="aql:value.identifier">
> > 
> >        ...
> > 
> > </controls>
> 
> It looks like a bug on our side. I'll try to push a patch this afternoon.

A little later than expected, but the patch is at https://git.eclipse.org/r/#/c/79802/ (not merged yet).
Comment 11 Pierre-Charles David CLA 2016-08-26 09:12:03 EDT
(In reply to Pierre-Charles David from comment #10)
> A little later than expected, but the patch is at
> https://git.eclipse.org/r/#/c/79802/ (not merged yet).

It's merged now; the next nightly build should hopefully fix your remaining issue.