Skip to main content



      Home
Home » Modeling » OCL » ConstraintProvider extension point
ConstraintProvider extension point [message #17289] Wed, 18 April 2007 10:24 Go to next message
Eclipse UserFriend
Originally posted by: vincent.legloahec.gmail.com

Hi everyone,

I'm developing a GMF editor which already use OCL constraints to validate
the diagram. It uses Audit Rules which work fine.

I would like to separate the definition of those rules from the editor
code. So I created a new plugin, declaring the constraintProvider
extension point, as it was previously defined in my GMF editor.
By now I can see those new rules in the Preference page (under Model
validation -> Constraints), but when I validate my diagram nothing
happens, no constraint is called by the batch validator.

Did I forget something ?
Thanks in advance.

Here is my constraintprovider extension :

N.B. namespaceUri="http://www.exemple.com/" is the same as the uri
definied in my ecore model.

<extension point="org.eclipse.emf.validation.constraintProviders">
<category id="constraints.category2"
mandatory="false"
name="category2">
</category>
<constraintProvider cache="true">
<package namespaceUri="http://www.exemple.com/">
</package>
<constraints categories="constraints.category2">
<constraint
id="constraints.constraint2"
lang="OCL"
mode="Batch"
name="constraint2"
severity="ERROR"
statusCode="11">
<![CDATA[ self.name.size() > 0 ]]>
<message>
message body text
</message>
<description>
description body text
</description>
<target
class="alk_comp.Component">
</target>
</constraint>
</constraints>
</constraintProvider>
</extension>
Re: [Validation] ConstraintProvider extension point [message #17315 is a reply to message #17289] Wed, 18 April 2007 10:39 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Vincent,

This isn't the correct newsgroup for EMF Validation-related questions. I'm
including eclipse.technology.emft for the benefit of other validation
users.

After you run validation, do you see any entries in the workspace log file?
Perhaps something indicating that the target EClass "alk_comp.Component"
could not be resolved?

Otherwise, I would check whether GMF perhaps generates a clientContext for
which you would need to define a binding on the
org.eclipse.emf.validation.constraintBindings extension point, to bind your
constraint category to that context.

HTH,

Christian


Vincent wrote:

> Hi everyone,
>
> I'm developing a GMF editor which already use OCL constraints to validate
> the diagram. It uses Audit Rules which work fine.
>
> I would like to separate the definition of those rules from the editor
> code. So I created a new plugin, declaring the constraintProvider
> extension point, as it was previously defined in my GMF editor.
> By now I can see those new rules in the Preference page (under Model
> validation -> Constraints), but when I validate my diagram nothing
> happens, no constraint is called by the batch validator.
>
> Did I forget something ?
> Thanks in advance.
>
> Here is my constraintprovider extension :
>
> N.B. namespaceUri="http://www.exemple.com/" is the same as the uri
> definied in my ecore model.
>
> <extension point="org.eclipse.emf.validation.constraintProviders">
> <category id="constraints.category2"
> mandatory="false"
> name="category2">
> </category>
> <constraintProvider cache="true">
> <package namespaceUri="http://www.exemple.com/">
> </package>
> <constraints categories="constraints.category2">
> <constraint
> id="constraints.constraint2"
> lang="OCL"
> mode="Batch"
> name="constraint2"
> severity="ERROR"
> statusCode="11">
> <![CDATA[ self.name.size() > 0 ]]>
> <message>
> message body text
> </message>
> <description>
> description body text
> </description>
> <target
> class="alk_comp.Component">
> </target>
> </constraint>
> </constraints>
> </constraintProvider>
> </extension>
Previous Topic:[Announce] MDT OCL 1.1.0 I200704131044 is available
Next Topic:Can OCL initialization constraints modify the system ?
Goto Forum:
  


Current Time: Thu Jul 03 10:29:42 EDT 2025

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

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

Back to the top