Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Validation] How to debug a activation of a constraint
[Validation] How to debug a activation of a constraint [message #424802] Wed, 05 November 2008 19:58 Go to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
I've got a AbstractModelConstraint that, for some reason, is not getting
invoked. In fact, its class is not even being loaded. I've written a
bunch of these things and configured them via the constraintBindings and
constraintProviders extension points, but this one is not activating for
some reason that I can't determine. I'm pretty sure it is something
incorrect in the binding or category or provider configuration, but I
just don't know what.

So how does one go about debugging why my particular constraint is not
being invoked when the appropriate EObject is changed/persisted? I tried
setting some breakpoints but the code in the validation framework is not
all that easy to follow if you aren't familiar with it.

Any help is appreciated,
Eric
Re: [Validation] How to debug a activation of a constraint [message #424916 is a reply to message #424802] Mon, 10 November 2008 14:10 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
Bump.
No-one can point me in the right direction? I'm dead in the water with
this...


On 11/5/2008 2:58 PM, Eric Rizzo wrote:
> I've got a AbstractModelConstraint that, for some reason, is not getting
> invoked. In fact, its class is not even being loaded. I've written a
> bunch of these things and configured them via the constraintBindings and
> constraintProviders extension points, but this one is not activating for
> some reason that I can't determine. I'm pretty sure it is something
> incorrect in the binding or category or provider configuration, but I
> just don't know what.
>
> So how does one go about debugging why my particular constraint is not
> being invoked when the appropriate EObject is changed/persisted? I tried
> setting some breakpoints but the code in the validation framework is not
> all that easy to follow if you aren't familiar with it.
>
> Any help is appreciated,
> Eric
Re: [Validation] How to debug a activation of a constraint [message #424921 is a reply to message #424802] Mon, 10 November 2008 19:29 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Eric,

Thanks for the nudge. Sometimes, I seem to miss a post.

Whenever I have this problem, I start by looking in the workspace log to
see whether the configuration of my constraint bindings made any boo-boo.

If I see nothing in the log, then I put a breakpoint in the
ClientContextManager::getBindings(EObject, Collection) method to see
which constraints we have gotten from providers that are applicable my
object on which I am expecting the problem constraint to be evaluated.

If the expected constraint isn't among them, then I start over again
with a breakpoint in the IModelConstraintProvider implementation that I
was expecting to provide the constraint, in its

Otherwise, I proceed with a breakpoint in the
ClientContextManager::getBindingsFor(EObject) method. This tells me
which client contexts seem to match the object an which I am expecting
some constraint to be evaluated.

If the right context matches, then I continue with a breakpoint in
ClientContextManager::getBindings(IClientContext, Collection) to see
which constraints match the client context, and whether the constraint
that I expected to be evaluated was filtered out at this stage.

If none of that turns up an answer, then perhaps somebody has installed
an IConstraintFilter on your IValidator to do client-directed filtering?

HTH,

Christian

Eric Rizzo wrote:
> I've got a AbstractModelConstraint that, for some reason, is not getting
> invoked. In fact, its class is not even being loaded. I've written a
> bunch of these things and configured them via the constraintBindings and
> constraintProviders extension points, but this one is not activating for
> some reason that I can't determine. I'm pretty sure it is something
> incorrect in the binding or category or provider configuration, but I
> just don't know what.
>
> So how does one go about debugging why my particular constraint is not
> being invoked when the appropriate EObject is changed/persisted? I tried
> setting some breakpoints but the code in the validation framework is not
> all that easy to follow if you aren't familiar with it.
>
> Any help is appreciated,
> Eric
Previous Topic:Can GenModel generate TreeNodeItemProvider?
Next Topic:migrate data with Teneo
Goto Forum:
  


Current Time: Thu Apr 18 23:15:08 GMT 2024

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

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

Back to the top