Closed eclipse-ocl-bot closed 2 hours ago
By Ed Willink on Jan 17, 2016 14:08
The attachment use a /sandbox/OCLforUML. Not provided or rmapped.
Replacing it with the standard OCLforUML gives bad proxies.
Need a useable repro.
By Klaas Gadeyne on Jan 18, 2016 05:58
Not sure I understand with you mean with bad proxies.
The "bug submission" pre-dates the availability of OCL4UML as a registered profile in papyrus. Yet, revisiting the model, updating the profile to the registered version and trying to create a repro allowed me to conclude this is not a bug! Indeed, the iterate expression of Constraint 2 is not valid, as "s : Real" lacks an initialization expression.
Small side note: One thing that one could still argue is that the xtext parser is not very helpful (to say the least) for this particular syntax error: The "Unresolved iteration" error message does not really point the modeler straight to the fact that he forgot to provide the initialization expression.
By Ed Willink on Jan 18, 2016 06:28
'proxies' was perhaps the wrong word. My adjusted xmi:id's were not resolved.
Thanks for getting back with the not-a-problem.
Inadequate validation is certainly a problem. I estimate that the OCL validation currently has perhaps 50% coverage, because it is auto-generated from
GIT\org.eclipse.ocl\plugins\org.eclipse.ocl.pivot\model\Pivot.ocl
I occasionally add a bit more, but it's waiting for a thorough review that incorporates the validation appropriate to template types. A bit marginal whether this will get done for Neon. My main focus for Neon is QVTr for real, and the auto-generated CS2AS replacement for the manual OCL parser.
Once we have full validation we can look at helpful validation messages too.
| --- | --- | | Bugzilla Link | 479346 | | Status | RESOLVED INVALID | | Importance | P3 enhancement | | Reported | Oct 08, 2015 10:26 EDT | | Modified | Jan 18, 2016 06:28 EDT | | Version | 6.0.0 | | Reporter | Klaas Gadeyne |
Description
Created attachment 257161\ Demonstrates the bug
Tooling info: Papyrus and OCL mars nightly.
Steps to reproduce:
This results in:
Error "Parsing error for RootElement::ConstraintBlock1::Constraint1::Attribute1 = Attribute2 and Attribute3->iterate(v : ValueType1, s : Real | s + v) = Attribute1 and Attribute3->collect(v | v)->sum() = Attribute1 :\ The 'ConstraintBlock1::Constraint1' constraint is invalid: 'Attribute1 = Attribute2 and Attribute3->iterate(v : ValueType1, s : Real | s + v) = Attribute1 and Attribute3->collect(v | v)->sum() = Attribute1'\ 1: Unresolved Iteration 'Set(RootElement::ValueType1)::iterate(v : ValueType1, s : Real| s + v)'" OpaqueExpression1 RootElement::ConstraintBlock1::Constraint1 EMF Problem
The iterate construct seems to yield problems...
:compression: OCL4UML-Iterate.zip