validation using the org.eclipse.emf.validation.constraintProviders extension point [message #597184] |
Wed, 20 December 2006 07:32 |
Hallvard Traetteberg Messages: 673 Registered: July 2009 Location: Trondheim, Norway |
Senior Member |
|
|
I have a constraint that applies to one kind of object (Type) which
may be attached to several kinds of other objects (Variable,
Connection and Computation). I want to evaluate the constraint
whenever this Type object is (re)attached to the relevant Variable,
Connection and Computation objects. Hence, I implemented an
AbstractModelConstraint and declared the constraint using the
extension point.
First I tried the following (notice the multiple targets):
<constraint lang="Java"
class=" no.hal.diamodl.diagram.custom.constraints.ClassTypeConstrain t "
...>
<target class="Variable">
<event name="Set"><feature name="type"/></event>
</target>
<target class="Connection">
<event name="Set"><feature name="function"/></event>
</target>
<target class="Computation">
<event name="Set"><feature name="function"/></event>
</target>
</constraint>
However, the constraint was never evaluated! When I split the
declaration into three constraints, each with only one target, it
worked. However, in the description of the extension point, the target
element is allowed zero, one or more times? Is this a bug or is my
understanding flawed?
Hallvard
|
|
|
Powered by
FUDForum. Page generated in 0.02730 seconds