ITraversalStrategy breaking 'validation.constraintBindings' ? [message #567038] |
Wed, 15 February 2006 17:38 |
Radomil Dvorak Messages: 249 Registered: July 2009 |
Senior Member |
|
|
Hi,
I have a usecase declaring constraints targeted to a particular EClass but
requiring additional target refinement
based on the EObject instance state. In other words, not every instance of
that type is the appropriate target.
I have tried to use 'validation.constraintBindings' extension point to
define a <clientContext> with <enablement> or custom <selector> enforcing my
specific condition.
This works, but only partly.
It stops working in case I declare multiple constraints bound in different
client contexts and
these constraints are targeted on EClasses whose instances are in the same
validated sub-tree.
The reason is that the default strategy used by IBatchValidator assumes that
only the root elements of the traversal
may be in different client contexts.
I have found all this clearly described in ITraversalStrategy interface and
I understand the reasons for introducing
these 'optimistic' strategies. What only confused me a bit was that my
EObject was checked
during the validation step but no applicable constraints were found.
Of course, I can provide my own 'pessimistic' strategy and everything works
fine, just with the cost of frequent
re-computing of the client context.
But I still have a feeling that this is not the right solution.
Is there any better way how to achieve this?
Regards,
/Radek
|
|
|
Powered by
FUDForum. Page generated in 0.03000 seconds