Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Re: [Validation] ConstraintProvider extension point
Re: [Validation] ConstraintProvider extension point [message #604851] Wed, 18 April 2007 14:39
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:[Teneo]Problem Persisting GMF diagram to HibernateResource
Next Topic:Re: [Validation] ConstraintProvider extension point
Goto Forum:
  


Current Time: Fri Apr 26 01:01:54 GMT 2024

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

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

Back to the top