Skip to main content



      Home
Home » Modeling » EMF » [EMF] Validation framework: constrain instances (instead of classes)
[EMF] Validation framework: constrain instances (instead of classes) [message #1368979] Tue, 20 May 2014 07:10 Go to next message
Eclipse UserFriend
Hi,

I'm currently working with OCL constraints and I was wondering if it's possible to add constraints specific to an instance (a given EObject, as opposed to a constraint on an EClass, which applies to all instances of this class).

I didn't see anything like this available and I wanted to ask before developing my own validator.

Regards,
BQ.
Re: [EMF] Validation framework: constrain instances (instead of classes) [message #1369198 is a reply to message #1368979] Tue, 20 May 2014 09:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi, BQ,

No, this sort of use case is what the filtering of constraints using
IConstraintFilters attached to an IValidator is intended for. You
shouldn't need to create your own validator for this.

Cheers,

Christian

On 2014-05-20 11:10:24 +0000, Bertrand Quenin said:

> Hi,
>
> I'm currently working with OCL constraints and I was wondering if it's
> possible to add constraints specific to an instance (a given EObject,
> as opposed to a constraint on an EClass, which applies to all instances
> of this class).
>
> I didn't see anything like this available and I wanted to ask before
> developing my own validator.
>
> Regards,
> BQ.
Re: [EMF] Validation framework: constrain instances (instead of classes) [message #1369468 is a reply to message #1369198] Tue, 20 May 2014 11:51 Go to previous messageGo to next message
Eclipse UserFriend
Ok, thanks. It seems related to EMF validation framework and I only used the diagnostician for now. I'm going to have a look at this.
Re: [EMF] Validation framework: constrain instances (instead of classes) [message #1369701 is a reply to message #1369468] Tue, 20 May 2014 14:01 Go to previous message
Eclipse UserFriend
Hi,

Sorry, I assumed you were working with that other framework because you
mentioned implementing a custom validator (in the intrinsic EMF
framework, validators are generated for us). In your case, constraints
are declared (and optionally defined) in the Ecore model, so naturally
there is no tie-in to specific instances.

So, yes, probably you'll be implementing your own EValidator (to wrap
the one that's generated for you) and it can decide which constraints
to evaluate on which objects.

Cheers,

Christian


On 2014-05-20 15:51:33 +0000, Bertrand Quenin said:

> Ok, thanks. It seems related to EMF validation framework and I only
> used the diagnostician for now. I'm going to have a look at this.
Previous Topic:[EMF Query] Using EMF Query outside Eclipse (with OCL)
Next Topic:[ChangeRecoder] Problem with beginRecording() after endRecording() was called
Goto Forum:
  


Current Time: Wed Jul 23 14:41:33 EDT 2025

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

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

Back to the top