Live Validation allows invalid states (Misconception of live validation?) [message #152516] |
Fri, 28 September 2007 08:25  |
Eclipse User |
|
|
|
Hello,
I got the following behavior when using Live Validation with GMF. I try
to explain how to reproduce it as I think there might be a misconception
on behalf of the live validation.
I have a constraint with Domain Element Target EdgeElement, represented
as an edge. The validity of an EdgeElement relies on two associated
Domain Element of type NodeElement (the source and target of the edge)
If I am now changing a value of a NodeElement the live validation does
not prevent this (even if an EdgeElement becomes invalid) as it is only
checking the constraints that target the affected elements - in this
case EdgeElements.
Ths means if I have the same constraint both as live and batch version
and I have a valid model consisting of 1 EdgeElements connecting 2
NodeElements and change a value of a NodeElements and run batch
validation again, the EdgeElement is marked invalid.
Am I missing something, is this intended or shall I file a bug report on
this?
Cheers,
Alexander
|
|
|
Re: Live Validation allows invalid states (Misconception of live validation?) [message #152558 is a reply to message #152516] |
Fri, 28 September 2007 11:36  |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Alexander,
The correct newsgroup for EMF Validation questions is the EMF newsgroup
(which I have included in this reply).
Live validation actually validates Notifications. By default, the only
notifications that it sees will be those sent by the model. Since, in your
case, objects affected by an operation are not sending notifications on any
particular feature (because the relationship is one-sided, i.e., has no
eOpposite), validation doesn't know that the objects are affected.
You can address this using the "notification generators" capability added in
the 1.1 release. An INotificationGenerator registered on the
org.eclipse.emf.validation.eventTypes extension point can analyze the
notifications to be validated and inject custom notifications (new "event
types") sourced in your affected objects. Your constraints, then, can
target these new event types.
Have a look at the EMF Validation Developer Guide documentation in the
Eclipse help viewer for more details.
HTH,
Christian
Alexander Dotor wrote:
> Hello,
>
> I got the following behavior when using Live Validation with GMF. I try
> to explain how to reproduce it as I think there might be a misconception
> on behalf of the live validation.
>
> I have a constraint with Domain Element Target EdgeElement, represented
> as an edge. The validity of an EdgeElement relies on two associated
> Domain Element of type NodeElement (the source and target of the edge)
>
> If I am now changing a value of a NodeElement the live validation does
> not prevent this (even if an EdgeElement becomes invalid) as it is only
> checking the constraints that target the affected elements - in this
> case EdgeElements.
>
> Ths means if I have the same constraint both as live and batch version
> and I have a valid model consisting of 1 EdgeElements connecting 2
> NodeElements and change a value of a NodeElements and run batch
> validation again, the EdgeElement is marked invalid.
>
> Am I missing something, is this intended or shall I file a bug report on
> this?
>
> Cheers,
> Alexander
|
|
|
Powered by
FUDForum. Page generated in 0.02345 seconds