Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » validation using the org.eclipse.emf.validation.constraintProviders extension point
validation using the org.eclipse.emf.validation.constraintProviders extension point [message #65107] |
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
|
|
|
Re: validation using the org.eclipse.emf.validation.constraintProviders extension point [message #65174 is a reply to message #65107] |
Wed, 20 December 2006 13:54 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Hallvard,
At first blush, this looks like a bug, but that is odd because I have seen
exactly this kind of scenario work as expected in other applications (using
a model as complex as UML). I don't see anything evidently wrong with your
constraint declaration.
Would you be able to reduce the problem to a small test case that you can
attach to a bugzilla? Then I can have a closer look at it. I'm glad that
you have a work-around, for now, but it isn't nice because you don't want
users to be faced with three constraints where there should only be one ...
Cheers,
Christian
Hallvard Tr�teberg wrote:
> 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
|
|
|
Re: validation using the org.eclipse.emf.validation.constraintProviders extension point [message #597217 is a reply to message #65107] |
Wed, 20 December 2006 13:54 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Hallvard,
At first blush, this looks like a bug, but that is odd because I have seen
exactly this kind of scenario work as expected in other applications (using
a model as complex as UML). I don't see anything evidently wrong with your
constraint declaration.
Would you be able to reduce the problem to a small test case that you can
attach to a bugzilla? Then I can have a closer look at it. I'm glad that
you have a work-around, for now, but it isn't nice because you don't want
users to be faced with three constraints where there should only be one ...
Cheers,
Christian
Hallvard Tr�teberg wrote:
> 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
|
|
|
Goto Forum:
Current Time: Thu Dec 26 10:11:18 GMT 2024
Powered by FUDForum. Page generated in 0.04083 seconds
|