|Re: OCL Console using CompleteOCL [message #790501 is a reply to message #790466]
||Sat, 04 February 2012 10:40
| Ed Willink
Registered: July 2009
Ok. I see what you're trying to do.
Doing a quick search of "ssential" gives me only 25 matches to consider.
A couple don't need a CompleteOCL refinement. Most just change
trivially. But EssentialOCLPlugin.LANGUAGE_ID has no counterpart. This
gives the magic string that tells Xtext what grammar to use. I suspect
you've not provided the correct replacement.
I've just added the LANGUAGE_ID to the other plugins, so it will
eventually appear on master and M6. It's currently on the bug/368612
development branch along with an experimental menu action that
successfully loads a Complete OCL document into the Sample Ecore Editor.
Complete OCL then contributes to the Ecore Editor Validation (at M2).
You'll find that CompleteOCLEObjectValidator.initialize() does most of
the hard work of reading the Complete OCL document, binding it to an
Ecore model and installing a variant validation.
The current operation of the Console is:
Using an interactively typed expression and the current adaptable to
EObject non-Console selection, evaluate the expression with the
selection as the self object.
What I think you propose seems sensible:
Using an interactively typed document and the current adaptable to
EObject non-Console selection, invoke validate on the selected EObject
using the additional constraints in the interactive document.
But there is the minor ergonomic issue that <Enter> executes in the
Console, and you really don't want to do that while editing documents.
So you will need a Validate button.
Then if you can add Complete OCL in the Console, wouldn't it be nice to
evaluate some expressions using it. Ah we just took that facility away.
In http://wiki.eclipse.org/MDT/OCL/Debugger you will find my planned
direction for the Console towards a full Debugger and so I'm trying to
align your idea; looks like progress towards an enhanced Input View.
It seems that for a non-trivial Complete OCL document, you would want to
load that document either into the model editor or the Console and fix
the bugs whereby changes to the Complete OCL document in the Complete
OCL editor do not yet update in other editors correctly. Then you can
just evaluate as-is.
For small experimental Complete OCL, your idea seems convenient, and
bypasses the current synchronization limitations.
I suggest adding a third window to the OCL Console for an interactive
Complete OCL document.
Add a <Validate> button to validate the selected EObject.
[Add a <Run> button to execute the expression]
Add a display/hide Complete OCL window menu option
Add Load/Save Complete OCL window options
This seems like functionality that could be useful to everyone, so if
you are able to contribute your improvements that would be good. If so,
please branch OCL from https://github.com/eclipse/ocl/network so that
your changes are traceable and synchronizable with the development GIT.
Please create a Bugzilla entry before you start so that all commits are
prefixed by [bugnum].
On 04/02/2012 09:29, D O wrote:
> Hi Ed,
> I agree that my request was not very clear. Currently, OCL console
> uses EssentialOCL to parse, validate, etc. of expression, right.
> My idea is to make OCL console uses CompleteOCL. I need: 1. to
> understand how OCL API works, 2. validate (syntax & semantics) of OCL
> expression on UML models (I know it exists but I like the manner
> proposed by the console).
> To make it I replaced all references to EssentialOCL by references to
> CompleteOCL in the plugin org.eclipse.ocl.examples.xtext.console.
> The result is not satisfactory as described in previous post.
> Best regard.
Powered by FUDForum
. Page generated in 0.12968 seconds