Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Validation constraint provider not invoked(Registered validation constraint provider not invoked)
Validation constraint provider not invoked [message #551613] Sun, 08 August 2010 04:50 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: August 2010
Junior Member
I'm having trouble getting EMF to invoke my constraint provider in either batch or live mode. I've followed the EMF validation tutorial to the letter for both the batch and live validation modes and no dice.

One question I have is how is the namespaceUri field within the constraintProvider definition within plugin.xml supposed to be formatted. I've seen examples like (which comes from the EMF validation tutorial):

<package namespaceUri=" http:///org/eclipse/emf/metamodel/example/pde/library.ecore/ 1.0.0"/>

And examples where the URI is more of a standard URL (www.<companyname>.com/) as well as cases where the ecore file name is not fully spelled or or there is no version identifier included. What is the appropriate format? And does it really matter? The only straw I'm grasping at is that the namespaceUri somehow does not lineup properly with the actual namespace URI and thus the constraintProvider is not getting invoked.

Any other things I should look at to try and determine what is going wrong (or not happening)?

Any help greatly appreciated,

DaveF
Re: Validation constraint provider not invoked [message #551616 is a reply to message #551613] Sun, 08 August 2010 05:21 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi DaveF

packageURIs are almost arbitrary character sequences that must be
spelled just right. The XxxPackage.eNS_USI field and the plugin.xml
registration are two places where the same spelling should appear. You
can use the Modisco Model Browser or just the Load Resource...->Browse
Registered Packages in the Sample Ecore Editor to see what the correct
spelling is and whether the package is installed.

Helios introduced Validation (and Setting and Invocation) Delegates to
EMF providing another and better integrated validation option. These
delegates may invoke OCL directly see
http://wiki.eclipse.org/MDT/OCLinEcore

Regards

Ed Willink


On 08/08/2010 05:51, huskerdhf@gmail.com wrote:
> I'm having trouble getting EMF to invoke my constraint provider in
> either batch or live mode. I've followed the EMF validation tutorial to
> the letter for both the batch and live validation modes and no dice.
>
> One question I have is how is the namespaceUri field within the
> constraintProvider definition within plugin.xml supposed to be
> formatted. I've seen examples like (which comes from the EMF validation
> tutorial):
>
> <package
> namespaceUri=" http:///org/eclipse/emf/metamodel/example/pde/library.ecore/ 1.0.0"/>
>
>
> And examples where the URI is more of a standard URL
> (www.<companyname>.com/) as well as cases where the ecore file name is
> not fully spelled or or there is no version identifier included. What is
> the appropriate format? And does it really matter? The only straw I'm
> grasping at is that the namespaceUri somehow does not lineup properly
> with the actual namespace URI and thus the constraintProvider is not
> getting invoked.
>
> Any other things I should look at to try and determine what is going
> wrong (or not happening)?
>
> Any help greatly appreciated,
>
> DaveF
Re: Validation constraint provider not invoked [message #551870 is a reply to message #551613] Mon, 09 August 2010 21:21 Go to previous message
No real name is currently offline No real nameFriend
Messages: 2
Registered: August 2010
Junior Member
Ed,

Thanks for the reply and pointing me towards the validation delegate functionality introduced in Helios. I'll check that out at some point.

I did get my scenario working and part of the reason was the namespace URI not matching between the constraintProvider declaration and the domain model NS URI. But I also at some point in trying different things to get the validation checks invoked I had removed the constraintBindings declaration to bind the constraintProvider to the client context. In reading the EMF validation tutorial I got the impression that the client context was optional but that is clearly not the case. After getting the NS URI set properly and restoring the constraintBindings definition, my constraint provider is indeed getting invoked.

Cheers,

DaveF
Previous Topic:[EMF] Default Resource for a meta-model
Next Topic:multiple files for XSD emf models
Goto Forum:
  


Current Time: Thu Apr 25 10:36:11 GMT 2024

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

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

Back to the top