Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 672
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:validation using the org.eclipse.emf.validation.constraintProviders extension point
Next Topic:[Teneo] Should we use Hibernate or JDO?
Goto Forum:
  


Current Time: Sun Feb 28 08:17:27 GMT 2021

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

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

Back to the top