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 05:53 Go to next message
Cedric Moonen is currently offline Cedric Moonen
Messages: 216
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 06:08 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 3224
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 06:27 Go to previous messageGo to next message
Cedric Moonen is currently offline Cedric Moonen
Messages: 216
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 15:41 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 3224
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 11:49 Go to previous message
Cedric Moonen is currently offline Cedric Moonen
Messages: 216
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
Previous Topic:[Complete OCL] Correct way of importing referred metamodels
Next Topic:OCL Constraint in ecore model
Goto Forum:
  


Current Time: Tue Jun 18 02:05:33 EDT 2013

Powered by FUDForum. Page generated in 0.05319 seconds