|
Re: [EMF] Validation framework: constrain instances (instead of classes) [message #1369198 is a reply to message #1368979] |
Tue, 20 May 2014 13:17 |
|
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 #1369701 is a reply to message #1369468] |
Tue, 20 May 2014 18:01 |
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03882 seconds