Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL Console using CompleteOCL
OCL Console using CompleteOCL [message #789787] Fri, 03 February 2012 12:05 Go to next message
D O is currently offline D OFriend
Messages: 13
Registered: November 2011
Junior Member
Hi,

I need to validate OCL expressions on an UML model. The current version of the OCL console can not do it but it is a good basis.

My idea is to change in the OCL Console the link EssentialOCL to CompleteOCL.

The result of this work gives a validation error: missing EOF at '<First word of OCL expression>'.

What is the problem?, What is missing there?

DO
Re: OCL Console using CompleteOCL [message #789832 is a reply to message #789787] Fri, 03 February 2012 13:11 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

"change in the OCL Console the link EssentialOCL to CompleteOCL"

doesn't make sense to me so I cannot comment helpfully.

missing EOF at ...

is Xtext's way of saying you've got mismatching open/close punctuation
though I cannot produce a test case to give me that today.

Between email distractions, addition of a Load Complete OCL action for
https://bugs.eclipse.org/bugs/show_bug.cgi?id=368612 is my current
development activity. This should allow

Complete OCL at M1 in the Sample Reflective Ecore Editor
Complete OCL at M2 in the Sample Ecore Editor
Complete OCL at M2 in the OCLinEcore Editor
Complete OCL at M2 in the Complete OCL Editor
Complete OCL at M2 in the Sample UML Editor
Complete OCL at M2 in Papyrus
and probably in any tool that provides EObject selections or
IEditingDomainProvider editors

and if Complete OCL works at M2 for UML, stereotype constraints should
do too.

However the above would be 'executing Complete OCL' expressions on a UML
model. I'm not sure that is what you mean by "validate OCL expressions on".

Regards

Ed Willink

On 03/02/2012 12:05, D O wrote:
> Hi,
>
> I need to validate OCL expressions on an UML model. The current
> version of the OCL console can not do it but it is a good basis.
>
> My idea is to change in the OCL Console the link EssentialOCL to
> CompleteOCL.
>
> The result of this work gives a validation error: missing EOF at
> '<First word of OCL expression>'.
>
> What is the problem?, What is missing there?
>
> DO
Re: OCL Console using CompleteOCL [message #790466 is a reply to message #789832] Sat, 04 February 2012 09:29 Go to previous messageGo to next message
D O is currently offline D OFriend
Messages: 13
Registered: November 2011
Junior Member
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.

DO
Re: OCL Console using CompleteOCL [message #790501 is a reply to message #790466] Sat, 04 February 2012 10:40 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

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.

--------------------

However:

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].

Regards

Ed Willink




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.
>
> DO
Re: OCL Console using CompleteOCL [message #792749 is a reply to message #790501] Tue, 07 February 2012 11:10 Go to previous message
D O is currently offline D OFriend
Messages: 13
Registered: November 2011
Junior Member
Hi Ed,

Thank you for that very comprehensive answer.

I'm just an observation:

Has told you: "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."

It is simple, I think, to change the key. For example, the project uses Datatools <Alt> + <x> to start the execution (but you can always add a button).

DO
Previous Topic:[Announce] Eclipse OCL 3.1.2 (Indigo SR2) RC3 is now available
Next Topic:Problem OCL + Ecore Validation
Goto Forum:
  


Current Time: Thu Apr 25 13:23:14 GMT 2024

Powered by FUDForum. Page generated in 0.03639 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top