Closed eclipse-ocl-bot closed 1 month ago
By Sebastien GABEL on Dec 10, 2009 08:50
Created attachment 154231 (attachment deleted)\
The Topcased OCL evaluator plug-in
By Ed Willink on Dec 10, 2009 14:33
Can you please check that the attachment is correctly uploaded; did you specify binary file? I cannot open it.
By Sebastien GABEL on Dec 11, 2009 05:09
Created attachment 154301 (attachment deleted)\
Topcased OCL Evaluator plug-in
By Sebastien GABEL on Dec 11, 2009 05:17
All seemed ok from my side.\ I uploaded a new ZIP archive specifying binary mime type this time.\ Is it better now ?
By Ed Willink on Dec 11, 2009 11:42
Much better; thanks, it extracts and has no warnings at all.
I remember my first major contribution got a fair number of comments from Christian, so please don't be discouraged by the comments below. It's all trying to improve the quality of MDT/OCL; no doubt some of the comments are actually against MDT/OCL itself since I think Christian raised the quality level after he wrote the original interpreter.
I think that it is very unlikely that this code will be stable by M6 (March) so we need to give ourselves flexibility to evolve it, by shipping it as a bundled (rather than extra) examples plugin. Please use org.eclipse.ocl.examples.evaluator.ui throughout. Next year we will repackage as org.eclipse.ocl.evaluator.ui.
--------------------------\ When I add the missing API nature, there are three warnings:
TreeArrayContentProvider illegally extends ArrayContentProvider\ OCLEvaluationContentProvider extends ArrayContentProvider\ OCLStepContentProvider extends ArrayContentProvider
ArrayContentProvider is a trivial internal class, that you need to rewrite.
There are no exported packages.
There is a dependency on ocl.ecore but not on ocl.uml. It needs to work with both.
Some of the icons are probably available as Platform Shared Images. Others would\ be better to use the UML2 or ocl.edit icons.
OCL follows EMF coding practice; Ixxx is not used for interfaces.
I think that philosophically I prefer a View to a Console; New users look for views rather than consoles. I would prefer the category for the View to be "Modeling (OCL)" rather than "Other". Maybe Amalgam will get us all to share a Modeling category one day. The "Show In"-> menu of an EMF model should offer an "OCL Evaluator" option and when invoked this should preanswer the "Load Model".
Contrasting the (Evaluator) View to the (Interpreter) Console since I want the new contribution to be distinctly better rather than just different to the (Interpreter) Console.
The View does not currently evaluate; whereas the Console allowed an object context to be specified by selecting a model element, the View allows a class context to be specified from a pull-down menu. The Console therefore evaluates a expression value from an actual model, and the View evaluates a model expression from an independent entry. Both are probably useful. If a model element is selected, an expression can be evaluated on the model element (Console behaviour). If a meta-model element is selected, an expression can be evaluated in that type system (View behaviour).
The tree-based View display is much better, but what it is displaying is not. The Console evaluates as soon as Enter is entered; the View needs an arrow to be clicked. I would like to see auto-evaluation, after a one second delay, avoiding the need to hit a button and avoiding the ambiguity as to whether Enter is action or new line.
The Console (Bug 294200) supports a history of queries; the View does not. The Console clearly shows error messages, where you see them. The View puts errors on the status bar where they are easily overlooked; it would be better to (also) put the messages in the tree area since the tree area is dead in the presence of errors.
There is quite a lot of missing Console functionality. Ecore/UML. M1/M2. Load/Save expression.
The expression is unparsed using toString() which is a debug aid and so shows x.or(y) which is no longer valid.\ qvtd has a pretty printing unparser.
----\ Futures
Neither View nor Console support evaluation in an enhanced Document context; e.g
context SomeWhere\ def: something(x: T) ...
evaluate:\ something(5)
I think that in principle I want to open my model with a tool that supports element selection; e.g. a 'Sample Ecore Editor'. This automatically defines the meta-model. So the Console/View operates on the active editor selection and so knows a model and meta-model context. The Console/View needs an additional load OCL Document(s) capability to define additional constraints to be applied to the meta-model.
The editor may need to use qvtd derived editor. This is now loadable out of the box using http://eclipse.org/modeling/m2m/qvtd/resources/qvtd.psf.
There are many aspects of this View contribution that are prettier than the existing Console, but we need it to supplant the Console in nearly all respects. I hope you can provide some of the missing functionality.
It was only while committing the Bug 294200 contribution that I found its duplicate Bug 260641 that references uncommitted work in Bug 259922. I had assumed that Bug 259922 was a request for action, rather than a half completed enhancement. The first attachment to Bug 259922 is a ZIP file that loads without errors provided you change the OCL version to [3.0.0 to 4.0.0). It uses three views, which is not very user friendly, one for overall control, one for input and one for output. Of these, you might want to incorporate the overall control in place of your Load Model and Context.
By Sebastien GABEL on Dec 16, 2009 12:07
Ed,
First, thanks for your relevant comments. Do not worry, I am not discouraged at all. Now, it is clear that this initial contribution is not at the same maturity level than the OCL Console but it brings some interesting ideas (notably in term of UI).
According to you, among all points you mentioned, what are the most important to take into account in a first time ?
By Ed Willink on Dec 16, 2009 13:40
Evaluation with respect to a model selection is vital, losing as little existing functionality as possible.
Ignore the UML/Ecore comments. In dealing with the lack of a standard library model, this distinction may vanish. Similarly don't work on M1/M2 explicitly.
Show In->View is a nice but not essential touch.
Since this is going into the Examples feature, it does not have to be stable by M6, but it would be good to provide some opportunities to review it, otherwise we will have to stick with the old interpreter for another year.
So please work on this as a priority since at M7 just possibly M8 we will have to decide to accept/defer the contrbution and if it is deferred, ordinary users won't see it till June 2011 rather than June 2010.
By Sebastien GABEL on Mar 01, 2010 11:45
Created attachment 160497 Topcased OCL Evaluator plug-in
Last version
:compression: org.eclipse.ocl.examples.evaluator.ui.zip
By Ed Willink on Mar 02, 2010 14:35
We still seem to have the major problem that the new Evaluator View does not allow expressions to be evaluated with respect to model elements.
The code plugs in fine after specifying the same project-specific compiler settings as other OCL plugins - using compliance from J2SE-1.5 on build path.
As a result of the Bug 191689 contribution, we now have org.eclipse.ocl.ecore.tests/model/Company.xmi is a model conforming to Company.ecore which has embedded OCL. This provides a much more powerful standard environment to work with.
Therefore if I open Company.xmi with the Sample Ecore Editor I get to see two resources, the model and meta-model.
If I select a model element such as Employee Bob, I would hope to see the Context change to Employee Bob, allowing me to type an arbitrary expression/constraint for evaluation against Bob, (or a pull-down of model-defined constraints). Currently it seems that the context must be a meta-model class rather than a model element.
This is an absolutely fundamental behavioural discrepancy that makes the old OCL Console useful and the new OCL Evaluator View useless. Perhaps you can explain how the OCL Evaluator can be used to evaluate an expression on a model; I must be missing something.
I recommend using Company.xmi as a working example.
With the Interactive OCL Console I can:
select Employee Bob\ evaluate self.directReports\ evaluate self.reportsTo(self)
demonstrating that the new invocation and setting delegates are working as intended.
It would be good to support:
select Employee Amy\ save self as 'global' variable 'amy'.\ select Employee Bob\ evaluate self.reportsTo(amy)
The imminent OCL in Ecore editor example should be complementary to the OCL console/evaluator. The user should:
Open Company.xmi in the Sample Ecore Editor or Comapny Editor to provide model view/selection.\ Open Company.ecore in the OCL in Ecore Editor to provide interactive OCL tweaking (edit OCL constraint and perhaps save)\ Open OCL Console/Evaluator to evaluate known or experimental expressions over the model.
So perhaps we want context menus:
Config checkboxes could enable:\ auto set as self on model element select (link with selection)\ auto set as expression on model constraint select\ auto evaluate on self/expression change
By Ed Willink on Jun 26, 2010 13:36
Is anything happening?
You might want to run through the new OCLinEcore tutorial in the Helios OCL Developer guide.
There are plenty of opportunities for improvement, but the OCL Console almost as-is is remarkably useful.
By Ed Willink on Nov 20, 2010 07:36
Closing as WONTFIX since no useable contribution has been provided.
Please reopen if you wish to contribute after all.
By Ed Willink on May 27, 2011 02:58
Closing WONTFIXes.
By Ed Willink on May 29, 2012 13:24
Closing all bugs resolved in Indigo.
| --- | --- | | Bugzilla Link | 297475 | | Status | CLOSED WONTFIX | | Importance | P3 enhancement | | Reported | Dec 10, 2009 08:49 EDT | | Modified | May 29, 2012 13:24 EDT | | Version | 3.0.0 | | Reporter | Sebastien GABEL |
Description
User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.0.10) Gecko/2009042718 CentOS/3.0.10-1.el5.centos Firefox/3.0.10 (.NET CLR 3.5.30729)\ Build Identifier: M20090917-0800
This initial contribution is based on Eclipse 3.5.1 and works with OCL 1.3.0 and also with the latest CVS Head version.
How to use it :
Remaining tasks to accomplish :
Any comments or feedbacks are welcome. I am sure they will help me to go ahead.
Reproducible: Always