Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Complete OCL file used for GMF validation
Complete OCL file used for GMF validation [message #1021547] Wed, 20 March 2013 09:53 Go to next message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
Hello,

I have a complete OCL file which decorates my EMF model. I know would like this complete OCL file to be taken into account for validation of instances of my domain model created via a GMF editor (built on top of my domain model).

Is there a way to achieve this ? If yes, are there any tutorial about this ?

Thanks,
Cédric
Re: Complete OCL file used for GMF validation [message #1021558 is a reply to message #1021547] Wed, 20 March 2013 10:08 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

If the GMF editor uses a stnadard EMF Validation approach, you may have
some success using the Load Complete OCL Resource menu action (Juno
onwards).

The Complete OCL tutorial in the OCL documentation describes it.

Regards

Ed Willink

On 20/03/2013 09:53, Cedric Moonen wrote:
> Hello,
>
> I have a complete OCL file which decorates my EMF model. I know would
> like this complete OCL file to be taken into account for validation of
> instances of my domain model created via a GMF editor (built on top of
> my domain model).
>
> Is there a way to achieve this ? If yes, are there any tutorial about
> this ?
>
> Thanks,
> Cédric
Re: Complete OCL file used for GMF validation [message #1021573 is a reply to message #1021558] Wed, 20 March 2013 10:27 Go to previous messageGo to next message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
Hi Ed,

Thanks for the reply.

Quote:
If the GMF editor uses a stnadard EMF Validation approach, you may have
some success using the Load Complete OCL Resource menu action (Juno
onwards).


I don't know exactly how GMF handles that but as far as I know, it doesn't validate the model itself. OCL constraints that were added to the EMF model are validated correctly (with the custom messages and severity levels).

However, the "Load Complete OCL Resource" action doesn't appear when I right-click on the diagram.

In the documentation it is mentioned that:
Quote:
Prior to the Juno release, this meant that Complete OCL was only usable in custom Java applications since no standard modeling applications would load the complementing document.


This means I guess that you have to load the OCL resource programmatically. Is there any tutorial about that ?
I would also prefer this approach, since this avoids users to have to do unnecessary actions in the GMF editor (they don't have to know that our OCL constraints are in a separate file).

Thanks,
Cédric
Re: Complete OCL file used for GMF validation [message #1021850 is a reply to message #1021573] Wed, 20 March 2013 19:41 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

On 20/03/2013 10:27, Cedric Moonen wrote:
> Hi Ed,
>
> Thanks for the reply.
>
> Quote:
>> If the GMF editor uses a stnadard EMF Validation approach, you may
>> have some success using the Load Complete OCL Resource menu action
>> (Juno onwards).
>
>
> I don't know exactly how GMF handles that but as far as I know, it
> doesn't validate the model itself. OCL constraints that were added to
> the EMF model are validated correctly (with the custom messages and
> severity levels).
That's encouraging.
> However, the "Load Complete OCL Resource" action doesn't appear when I
> right-click on the diagram.
>
There is a missing usage of IAdaptable to convert the GEF selection to
an EObject. Fix pushed on a GIT branch and building now.

An N-build should be available tomorrow.
> In the documentation it is mentioned that:
> Quote:
>> Prior to the Juno release, this meant that Complete OCL was only
>> usable in custom Java applications since no standard modeling
>> applications would load the complementing document.
>
>
> This means I guess that you have to load the OCL resource
> programmatically. Is there any tutorial about that ?
> I would also prefer this approach, since this avoids users to have to
> do unnecessary actions in the GMF editor (they don't have to know that
> our OCL constraints are in a separate file).
There is some description in the OCL documentation. But you have to have
programmatic access.

Regards

Ed Willink
Re: Complete OCL file used for GMF validation [message #1022826 is a reply to message #1021850] Fri, 22 March 2013 15:49 Go to previous messageGo to next message
Cedric Moonen is currently offline Cedric MoonenFriend
Messages: 274
Registered: August 2009
Senior Member
Ed,

I've been trying the nightly build and indeed I now have a "Load Complete OCL Resource" in my GMF editor and the validation works fine.

Thanks for the help.
Cédric
Re: Complete OCL file used for GMF validation [message #1265728 is a reply to message #1022826] Thu, 06 March 2014 13:28 Go to previous messageGo to next message
Klaas Gadeyne is currently offline Klaas GadeyneFriend
Messages: 165
Registered: July 2009
Senior Member
Hi Ed,

we've recently retried building this on Kepler SR2, with

OCL Examples and Editors SDK 3.4.0.v20140303-1745 org.eclipse.ocl.examples.feature.group Eclipse Modeling Project

We noticed that the 'Load complete OCL Resource' command isn't available anymore in the pop-up menu when right-clicking on the gmf diagram. Could this be a regression (we've also noticed that in the standard EMF editor, the option has been renamed into "OCL -> Load Document")?

TIA,

Klaas
Re: Complete OCL file used for GMF validation [message #1265754 is a reply to message #1265728] Thu, 06 March 2014 14:06 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

There should be no change in Kepler SR2.

For Luna, as a minor contribution to Eclipse IDE integrity, I have been
moving all OCL contributions in communal contexts to OCL->, so Load
Complete OCL Resource is now OCL->Load Resource. Hopefully other
projects will behave similarly so we are not left wondering where on
earth the "Exexcute Transformation" option came from and what it does.

Regards

Ed Willink

On 06/03/2014 13:28, Klaas Gadeyne wrote:
> Hi Ed,
>
> we've recently retried building this on Kepler SR2, with
> OCL Examples and Editors SDK 3.4.0.v20140303-1745
> org.eclipse.ocl.examples.feature.group Eclipse Modeling Project
>
> We noticed that the 'Load complete OCL Resource' command isn't
> available anymore in the pop-up menu when right-clicking on the gmf
> diagram. Could this be a regression (we've also noticed that in the
> standard EMF editor, the option has been renamed into "OCL -> Load
> Document")?
>
> TIA,
>
> Klaas
Re: Complete OCL file used for GMF validation [message #1265840 is a reply to message #1265754] Thu, 06 March 2014 16:24 Go to previous messageGo to next message
Klaas Gadeyne is currently offline Klaas GadeyneFriend
Messages: 165
Registered: July 2009
Senior Member
Hi Ed,

Ed Willink wrote on Thu, 06 March 2014 09:06
Hi
There should be no change in Kepler SR2.


Indeed, if I revert my OCL examples and editors to the Kepler versions.

OCL Examples and Editors 3.3.2.v20140210-1137 org.eclipse.ocl.examples.feature.group Eclipse Modeling Project

I can run the command both in the standard EMF editor and the GMF editor.

Quote:

For Luna, as a minor contribution to Eclipse IDE integrity, I have been
moving all OCL contributions in communal contexts to OCL->, so Load
Complete OCL Resource is now OCL->Load Resource. Hopefully other
projects will behave similarly so we are not left wondering where on
earth the "Exexcute Transformation" option came from and what it does.



This works fine for the basic EMF editor, however, the "OCL -> Load Resource" menu is not available (anymore) using

OCL Examples and Editors SDK 3.4.0.v20140303-1745 org.eclipse.ocl.examples.feature.group Eclipse Modeling Project

in the GMF editor (running on top kepler SR2, that is). You mean this this would only work using a full Luna installation?

Regards,

Klaas

Re: Complete OCL file used for GMF validation [message #1265895 is a reply to message #1265840] Thu, 06 March 2014 18:02 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
HI

I have also tried to avoid poking irrelevant menu actions into all
possible views and then using a can-i-find-a-ResourceSet expression
filter by instead using only known editor names. Maybe I need to know
some more or give up trying to avoid wasting UI resources.

Regards

Ed Willink

On 06/03/2014 16:24, Klaas Gadeyne wrote:
> Hi Ed,
>
> Ed Willink wrote on Thu, 06 March 2014 09:06
>> Hi
>> There should be no change in Kepler SR2.
>
>
> Indeed, if I revert my OCL examples and editors to the Kepler versions.
>
> OCL Examples and Editors 3.3.2.v20140210-1137
> org.eclipse.ocl.examples.feature.group Eclipse Modeling Project
>
> I can run the command both in the standard EMF editor and the GMF editor.
>
> Quote:
>> For Luna, as a minor contribution to Eclipse IDE integrity, I have
>> been moving all OCL contributions in communal contexts to OCL->, so
>> Load Complete OCL Resource is now OCL->Load Resource. Hopefully other
>> projects will behave similarly so we are not left wondering where on
>> earth the "Exexcute Transformation" option came from and what it does.
>
>
>
> This works fine for the basic EMF editor, however, the "OCL -> Load
> Resource" menu is not available (anymore) using
> OCL Examples and Editors SDK 3.4.0.v20140303-1745
> org.eclipse.ocl.examples.feature.group Eclipse Modeling Project
> in the GMF editor (running on top kepler SR2, that is). You mean this
> this would only work using a full Luna installation?
>
> Regards,
>
> Klaas
>
>
Re: Complete OCL file used for GMF validation [message #1268186 is a reply to message #1265840] Mon, 10 March 2014 06:54 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The latest OCL I-build has the OCL-> menu available (again) for all
editors. (M6 is today so maybe you can wait).

Regards

Ed


On 06/03/2014 16:24, Klaas Gadeyne wrote:
> Hi Ed,
>
> Ed Willink wrote on Thu, 06 March 2014 09:06
>> Hi
>> There should be no change in Kepler SR2.
>
>
> Indeed, if I revert my OCL examples and editors to the Kepler versions.
>
> OCL Examples and Editors 3.3.2.v20140210-1137
> org.eclipse.ocl.examples.feature.group Eclipse Modeling Project
>
> I can run the command both in the standard EMF editor and the GMF editor.
>
> Quote:
>> For Luna, as a minor contribution to Eclipse IDE integrity, I have
>> been moving all OCL contributions in communal contexts to OCL->, so
>> Load Complete OCL Resource is now OCL->Load Resource. Hopefully other
>> projects will behave similarly so we are not left wondering where on
>> earth the "Exexcute Transformation" option came from and what it does.
>
>
>
> This works fine for the basic EMF editor, however, the "OCL -> Load
> Resource" menu is not available (anymore) using
> OCL Examples and Editors SDK 3.4.0.v20140303-1745
> org.eclipse.ocl.examples.feature.group Eclipse Modeling Project
> in the GMF editor (running on top kepler SR2, that is). You mean this
> this would only work using a full Luna installation?
>
> Regards,
>
> Klaas
>
>
Previous Topic:OCLHelper.getSyntaxHelp for properties on association ends
Next Topic:Is nsURI for Pivot Package elements mandatory?
Goto Forum:
  


Current Time: Fri Apr 26 06:21:00 GMT 2024

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

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

Back to the top