Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMFT Validation and accessing OCL custom files
EMFT Validation and accessing OCL custom files [message #420698] Tue, 08 July 2008 07:58 Go to next message
Clavreul Mickael is currently offline Clavreul MickaelFriend
Messages: 2
Registered: July 2009
Junior Member
Hi,

I've checked the entire mailing lists and newsgroup messages about that
particular point but I couldn't manage to find a solution to my problem.

Let me explain, I am trying to augment the validation process with
several OCL constraints for a specific instance of a metamodel.
I've followed the tutorials on EMF Validation and Using OCL and from the
Library example I succeeded in creating my own constraints for the
validation.
From org.eclipse.emf.validation.examples.general and
org.eclipse.emf.validation.examples.ocl I have modified, embedded
contraints in the plugin.xml files are evaluated and I get adequate results.
Now I would like to declare OCL constraints as separate files and I took
from the tutorial the constraintsProvider definition, but I do not know
how to bind this new provider to my validation component because I do
not have any category identifier in this particular constraintsProvider
element.

Could you help me a bit ?
Here is my constraintsProvider declaration (code is quite the same as
the tutorial one as I am trying to make it work first :)):

<extension
point="org.eclipse.emf.validation.constraintProviders"
id="oclProvider">

<!-- Custom constraint provider using OCL documents -->
<constraintProvider
class="org.eclipse.emf.validation.pam.ocl.OCLConstraintProvider "
category="Constraints from an OCL Document">
<package
namespaceUri=" http:///org/eclipse/emf/examples/library/extlibrary.ecore/1. 0.1"/>

<ocl path="constraints/library.ocl"/>
</constraintProvider>
</extension>

So I tried to create a constraintsBinding element with the category
"Constraints from an OCL Document" but it doesn't seem to work.

Thanks for your help.

Regards,

CLAVREUL Mickael.
Re: EMFT Validation and accessing OCL custom files [message #420707 is a reply to message #420698] Tue, 08 July 2008 13:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

--=-SdWvd+GZWfznlBgrbs/p
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi, Micka=C3=ABl,

The constraint bindings mechanism is quite orthogonal to the constraint
providers, so perhaps the same category identifier used in your
plugin.xml constraint provider (which you say works) would have the same
problem?

I don't see anything obviously wrong with your provider XML. Can you
show me your constraintBinding extension, too?

Try some breakpoints in the
org.eclipse.emf.validation.internal.service.ClientContextMan ager to
debug the association of your category with your client-context.

HTH,

Christian

P.S. - you aren't using the org.eclipse.emf namespace in your production
code, I hope? :-)

On Tue, 2008-07-08 at 09:58 +0200, Micka=C3=ABl CLAVREUL wrote:

> Hi,
>=20
> I've checked the entire mailing lists and newsgroup messages about that=20
> particular point but I couldn't manage to find a solution to my problem.
>=20
> Let me explain, I am trying to augment the validation process with=20
> several OCL constraints for a specific instance of a metamodel.
> I've followed the tutorials on EMF Validation and Using OCL and from the=20
> Library example I succeeded in creating my own constraints for the=20
> validation.
> From org.eclipse.emf.validation.examples.general and=20
> org.eclipse.emf.validation.examples.ocl I have modified, embedded=20
> contraints in the plugin.xml files are evaluated and I get adequate resul=
ts.
> Now I would like to declare OCL constraints as separate files and I took=20
> from the tutorial the constraintsProvider definition, but I do not know=20
> how to bind this new provider to my validation component because I do=20
> not have any category identifier in this particular constraintsProvider=20
> element.
>=20
> Could you help me a bit ?
> Here is my constraintsProvider declaration (code is quite the same as=20
> the tutorial one as I am trying to make it work first :)):
>=20
> <extension
> point=3D"org.eclipse.emf.validation.constraintProviders"
> id=3D"oclProvider">
>=20
> <!-- Custom constraint provider using OCL documents -->
> <constraintProvider=20
> class=3D"org.eclipse.emf.validation.pam.ocl.OCLConstraintProvider "
> category=3D"Constraints from an OCL Document">
> <package=20
> namespaceUri=3D"http:///org/eclipse/emf/examples/library/extlibrary.ecore=
/1.0.1"/>
>=20
> <ocl path=3D"constraints/library.ocl"/>
> </constraintProvider>
> </extension>
>=20
> So I tried to create a constraintsBinding element with the category=20
> "Constraints from an OCL Document" but it doesn't seem to work.
>=20
> Thanks for your help.
>=20
> Regards,
>=20
> CLAVREUL Mickael.

--=-SdWvd+GZWfznlBgrbs/p
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY>
Hi, Micka&#235;l,<BR>
<BR>
The constraint bindings mechanism is quite orthogonal to the constraint providers, so perhaps the same category identifier used in your plugin.xml constraint provider (which you say works) would have the same problem?<BR>
<BR>
I don't see anything obviously wrong with your provider XML.&nbsp; Can you show me your constraintBinding extension, too?<BR>
<BR>
Try some breakpoints in the org.eclipse.emf.validation.internal.service.ClientContextMan ager to debug the association of your category with your client-context.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
P.S. - you aren't using the org.eclipse.emf namespace in your production code, I hope?&nbsp; :-)<BR>
<BR>
On Tue, 2008-07-08 at 09:58 +0200, Micka&#235;l CLAVREUL wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hi,</FONT>

<FONT COLOR="#000000">I've checked the entire mailing lists and newsgroup messages about that </FONT>
<FONT COLOR="#000000">particular point but I couldn't manage to find a solution to my problem.</FONT>

<FONT COLOR="#000000">Let me explain, I am trying to augment the validation process with </FONT>
<FONT COLOR="#000000">several OCL constraints for a specific instance of a metamodel.</FONT>
<FONT COLOR="#000000">I've followed the tutorials on EMF Validation and Using OCL and from the </FONT>
<FONT COLOR="#000000">Library example I succeeded in creating my own constraints for the </FONT>
<FONT COLOR="#000000">validation.</FONT>
<FONT COLOR="#000000"> From org.eclipse.emf.validation.examples.general and </FONT>
<FONT COLOR="#000000">org.eclipse.emf.validation.examples.ocl I have modified, embedded </FONT>
<FONT COLOR="#000000">contraints in the plugin.xml files are evaluated and I get adequate results.</FONT>
<FONT COLOR="#000000">Now I would like to declare OCL constraints as separate files and I took </FONT>
<FONT COLOR="#000000">from the tutorial the constraintsProvider definition, but I do not know </FONT>
<FONT COLOR="#000000">how to bind this new provider to my validation component because I do </FONT>
<FONT COLOR="#000000">not have any category identifier in this particular constraintsProvider </FONT>
<FONT COLOR="#000000">element.</FONT>

<FONT COLOR="#000000">Could you help me a bit ?</FONT>
<FONT COLOR="#000000">Here is my constraintsProvider declaration (code is quite the same as </FONT>
<FONT COLOR="#000000">the tutorial one as I am trying to make it work first :)):</FONT>

<FONT COLOR="#000000">&lt;extension</FONT>
<FONT COLOR="#000000"> point=&quot;org.eclipse.emf.validation.constraintProvide rs&quot; </FONT>
<FONT COLOR="#000000"> id=&quot;oclProvider&quot;&gt;</FONT>

<FONT COLOR="#000000"> &lt;!-- Custom constraint provider using OCL documents --&gt;</FONT>
<FONT COLOR="#000000"> &lt;constraintProvider </FONT>
<FONT COLOR="#000000"> class=&quot;org.eclipse.emf.validation.pam.ocl.OCLConstr aintProvider&quot; </FONT>
<FONT COLOR="#000000"> category=&quot;Constraints from an OCL Document&quot;&gt;</FONT>
<FONT COLOR="#000000"> &lt;package </FONT>
<FONT COLOR="#000000">namespaceUri=&quot; http:///org/eclipse/emf/examples/library/extlibrary.ecore/1. 0.1&quot;/&gt;</FONT>

<FONT COLOR="#000000"> &lt;ocl path=&quot;constraints/library.ocl&quot;/&gt;</FONT >
<FONT COLOR="#000000"> &lt;/constraintProvider&gt;</FONT>
<FONT COLOR="#000000">&lt;/extension&gt;</FONT>

<FONT COLOR="#000000">So I tried to create a constraintsBinding element with the category </FONT>
<FONT COLOR="#000000">&quot;Constraints from an OCL Document&quot; but it doesn't seem to work.</FONT>

<FONT COLOR="#000000">Thanks for your help.</FONT>

<FONT COLOR="#000000">Regards,</FONT>

<FONT COLOR="#000000">CLAVREUL Mickael.</FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-SdWvd+GZWfznlBgrbs/p--
Re: EMFT Validation and accessing OCL custom files [message #420710 is a reply to message #420707] Tue, 08 July 2008 14:34 Go to previous messageGo to next message
Clavreul Mickael is currently offline Clavreul MickaelFriend
Messages: 2
Registered: July 2009
Junior Member
Hi, Christian,

Thank you for answering so quickly.

Don't worry, I don't use the org.eclipse.emf namespace in my plugins, it
is just because, as it's been 4 days I'm working on it, I'm trying to
make it work on very similar source code, not to be lost in all plugins
definitions.

I have written my owm plugins now that are OK with OCL constraints
declared in plugin.xml files of my differents plugins such as ocl and
general (clones of the example ones).
I found out an issue for my plugins to handle customs OCL files, but
it's a bit weird :
As soon as I created a clone of the
org.eclipse.emf.validation.examples.adapter plugin, my OCL custom files
are parsed and executed, but I don't see any obvious reason for that.

Here is my constraintsBindings (I didn't have the time to customize all
declarations with my own packages ;):

<extension
point="org.eclipse.emf.validation.constraintBindings">
<clientContext default="false"
id="org.eclipse.emf.validation.pde.general.ui.libraryContext ">
<selector
class="pam.general.constraints.ValidationDelegateClientSelector "/>
</clientContext>
<binding
context="org.eclipse.emf.validation.pde.general.ui.libraryContext "
category="emf-validation-example/ocl"/>
</extension>

I would like to point out also that OCL constraints declared in
plugins.xml are correctly handled only when an adapter is present. Is it
something agreed or has the examples been made in such a way ?

Last point, I would like to know why my custom OCL files provider is
considered whereas there is no binding for it.

Thanks for your help,

Regards,

CLAVREUL Mickael.

Christian W. Damus wrote:
> Hi, Mickaël,
>
> The constraint bindings mechanism is quite orthogonal to the constraint
> providers, so perhaps the same category identifier used in your
> plugin.xml constraint provider (which you say works) would have the same
> problem?
>
> I don't see anything obviously wrong with your provider XML. Can you
> show me your constraintBinding extension, too?
>
> Try some breakpoints in the
> org.eclipse.emf.validation.internal.service.ClientContextMan ager to
> debug the association of your category with your client-context.
>
> HTH,
>
> Christian
>
> P.S. - you aren't using the org.eclipse.emf namespace in your production
> code, I hope? :-)
>
> On Tue, 2008-07-08 at 09:58 +0200, Mickaël CLAVREUL wrote:
>> Hi,
>>
>> I've checked the entire mailing lists and newsgroup messages about that
>> particular point but I couldn't manage to find a solution to my problem.
>>
>> Let me explain, I am trying to augment the validation process with
>> several OCL constraints for a specific instance of a metamodel.
>> I've followed the tutorials on EMF Validation and Using OCL and from the
>> Library example I succeeded in creating my own constraints for the
>> validation.
>> From org.eclipse.emf.validation.examples.general and
>> org.eclipse.emf.validation.examples.ocl I have modified, embedded
>> contraints in the plugin.xml files are evaluated and I get adequate results.
>> Now I would like to declare OCL constraints as separate files and I took
>> from the tutorial the constraintsProvider definition, but I do not know
>> how to bind this new provider to my validation component because I do
>> not have any category identifier in this particular constraintsProvider
>> element.
>>
>> Could you help me a bit ?
>> Here is my constraintsProvider declaration (code is quite the same as
>> the tutorial one as I am trying to make it work first :)):
>>
>> <extension
>> point="org.eclipse.emf.validation.constraintProviders"
>> id="oclProvider">
>>
>> <!-- Custom constraint provider using OCL documents -->
>> <constraintProvider
>> class="org.eclipse.emf.validation.pam.ocl.OCLConstraintProvider "
>> category="Constraints from an OCL Document">
>> <package
>> namespaceUri=" http:///org/eclipse/emf/examples/library/extlibrary.ecore/1. 0.1"/>
>>
>> <ocl path="constraints/library.ocl"/>
>> </constraintProvider>
>> </extension>
>>
>> So I tried to create a constraintsBinding element with the category
>> "Constraints from an OCL Document" but it doesn't seem to work.
>>
>> Thanks for your help.
>>
>> Regards,
>>
>> CLAVREUL Mickael.
Re: EMFT Validation and accessing OCL custom files [message #420729 is a reply to message #420710] Tue, 08 July 2008 23:41 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

--=-/SRfJOsFra+ZbBi43QJZ
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi, Micka=C3=ABl,

See some replies in-line, below.

HTH,

Christian


On Tue, 2008-07-08 at 16:34 +0200, Micka=C3=ABl CLAVREUL wrote:

> Hi, Christian,
>=20
> Thank you for answering so quickly.
>=20
> Don't worry, I don't use the org.eclipse.emf namespace in my plugins, it=20
> is just because, as it's been 4 days I'm working on it, I'm trying to=20
> make it work on very similar source code, not to be lost in all plugins=20
> definitions.


Heh heh ... understood. I wasn't really worried.


> I have written my owm plugins now that are OK with OCL constraints=20
> declared in plugin.xml files of my differents plugins such as ocl and=20
> general (clones of the example ones).
> I found out an issue for my plugins to handle customs OCL files, but=20
> it's a bit weird :
> As soon as I created a clone of the=20
> org.eclipse.emf.validation.examples.adapter plugin, my OCL custom files=20
> are parsed and executed, but I don't see any obvious reason for that.


This is https://bugs.eclipse.org/191471 . The validation examples are
not independent; they really do need the adapter example in order to
run. This plug-in defines the client-context that is used by all of the
examples. It is also, it would seem, the client-context to which you
are binding your OCL constraints, which is why they run now.


> Here is my constraintsBindings (I didn't have the time to customize all=20
> declarations with my own packages ;):
>=20
> <extension
> point=3D"org.eclipse.emf.validation.constraintBindings">
> <clientContext default=3D"false"=20
> id=3D"org.eclipse.emf.validation.pde.general.ui.libraryContext ">
> <selector=20
> class=3D"pam.general.constraints.ValidationDelegateClientSelector "/>
> </clientContext>
> <binding=20
> context=3D"org.eclipse.emf.validation.pde.general.ui.libraryContext "
> category=3D"emf-validation-example/ocl"/>
> </extension>


Hmmm ... it looks like you are trying to define, on behalf of another
plug-in, a client-selector for a context that the other plug-in defines.
That is not permitted by the framework (though I think it isn't
prevented; it just breaks stuff). I would expect this to cause erratic
behaviour.


> I would like to point out also that OCL constraints declared in=20
> plugins.xml are correctly handled only when an adapter is present. Is it=20
> something agreed or has the examples been made in such a way ?


As I mentioned, this is a bug in the examples.


> Last point, I would like to know why my custom OCL files provider is=20
> considered whereas there is no binding for it.


A constraint provider will be invoked when it has no constraint-binding
under either of two conditions:


* the elements being validated do not match any defined
client-context. These implicitly match constraints that are not
bound to any context
* the elements being validated match a client-context flagged as a
"default" context. This is not recommended (it's for
compatibility with an earlier release of the API, before
contexts were introduced)



>=20
> Thanks for your help,
>=20
> Regards,
>=20
> CLAVREUL Mickael.
>=20
> Christian W. Damus wrote:
> > Hi, Micka=C3=ABl,
> >=20
> > The constraint bindings mechanism is quite orthogonal to the constraint=
=20
> > providers, so perhaps the same category identifier used in your=20
> > plugin.xml constraint provider (which you say works) would have the sam=
e=20
> > problem?
> >=20
> > I don't see anything obviously wrong with your provider XML. Can you=20
> > show me your constraintBinding extension, too?
> >=20
> > Try some breakpoints in the=20
> > org.eclipse.emf.validation.internal.service.ClientContextMan ager to=20
> > debug the association of your category with your client-context.
> >=20
> > HTH,
> >=20
> > Christian
> >=20
> > P.S. - you aren't using the org.eclipse.emf namespace in your productio=
n=20
> > code, I hope? :-)
> >=20
> > On Tue, 2008-07-08 at 09:58 +0200, Micka=C3=ABl CLAVREUL wrote:
> >> Hi,
> >>
> >> I've checked the entire mailing lists and newsgroup messages about tha=
t=20
> >> particular point but I couldn't manage to find a solution to my proble=
m.
> >>
> >> Let me explain, I am trying to augment the validation process with=20
> >> several OCL constraints for a specific instance of a metamodel.
> >> I've followed the tutorials on EMF Validation and Using OCL and from t=
he=20
> >> Library example I succeeded in creating my own constraints for the=20
> >> validation.
> >> From org.eclipse.emf.validation.examples.general and=20
> >> org.eclipse.emf.validation.examples.ocl I have modified, embedded=20
> >> contraints in the plugin.xml files are evaluated and I get adequate re=
sults.
> >> Now I would like to declare OCL constraints as separate files and I to=
ok=20
> >> from the tutorial the constraintsProvider definition, but I do not kno=
w=20
> >> how to bind this new provider to my validation component because I do=20
> >> not have any category identifier in this particular constraintsProvide=
r=20
> >> element.
> >>
> >> Could you help me a bit ?
> >> Here is my constraintsProvider declaration (code is quite the same as=20
> >> the tutorial one as I am trying to make it work first :)):
> >>
> >> <extension
> >> point=3D"org.eclipse.emf.validation.constraintProviders"
> >> id=3D"oclProvider">
> >>
> >> <!-- Custom constraint provider using OCL documents -->
> >> <constraintProvider=20
> >> class=3D"org.eclipse.emf.validation.pam.ocl.OCLConstraintProvider "
> >> category=3D"Constraints from an OCL Document">
> >> <package=20
> >> namespaceUri=3D"http:///org/eclipse/emf/examples/library/extlibrary.ec=
ore/1.0.1"/>
> >>
> >> <ocl path=3D"constraints/library.ocl"/>
> >> </constraintProvider>
> >> </extension>
> >>
> >> So I tried to create a constraintsBinding element with the category=20
> >> "Constraints from an OCL Document" but it doesn't seem to work.
> >>
> >> Thanks for your help.
> >>
> >> Regards,
> >>
> >> CLAVREUL Mickael.

--=-/SRfJOsFra+ZbBi43QJZ
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY>
Hi, Micka&#235;l,<BR>
<BR>
See some replies in-line, below.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Tue, 2008-07-08 at 16:34 +0200, Micka&#235;l CLAVREUL wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hi, Christian,</FONT>

<FONT COLOR="#000000">Thank you for answering so quickly.</FONT>

<FONT COLOR="#000000">Don't worry, I don't use the org.eclipse.emf namespace in my plugins, it </FONT>
<FONT COLOR="#000000">is just because, as it's been 4 days I'm working on it, I'm trying to </FONT>
<FONT COLOR="#000000">make it work on very similar source code, not to be lost in all plugins </FONT>
<FONT COLOR="#000000">definitions.</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
Heh heh ... understood.&nbsp; I wasn't really worried.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">I have written my owm plugins now that are OK with OCL constraints </FONT>
<FONT COLOR="#000000">declared in plugin.xml files of my differents plugins such as ocl and </FONT>
<FONT COLOR="#000000">general (clones of the example ones).</FONT>
<FONT COLOR="#000000">I found out an issue for my plugins to handle customs OCL files, but </FONT>
<FONT COLOR="#000000">it's a bit weird :</FONT>
<FONT COLOR="#000000">As soon as I created a clone of the </FONT>
<FONT COLOR="#000000">org.eclipse.emf.validation.examples.adapter plugin, my OCL custom files </FONT>
<FONT COLOR="#000000">are parsed and executed, but I don't see any obvious reason for that.</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
This is <A HREF="https://bugs.eclipse.org/191471">https://bugs.eclipse.org/191471</A> .&nbsp; The validation examples are not independent; they really do need the adapter example in order to run.&nbsp; This plug-in defines the client-context that is used by all of the examples.&nbsp; It is also, it would seem, the client-context to which you are binding your OCL constraints, which is why they run now.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Here is my constraintsBindings (I didn't have the time to customize all </FONT>
<FONT COLOR="#000000">declarations with my own packages ;):</FONT>

<FONT COLOR="#000000">&lt;extension</FONT>
<FONT COLOR="#000000"> point=&quot;org.eclipse.emf.validation.constraintBinding s&quot;&gt; </FONT>
<FONT COLOR="#000000"> &lt;clientContext default=&quot;false&quot; </FONT>
<FONT COLOR="#000000"> id=&quot;org.eclipse.emf.validation.pde.general.ui.libra ryContext&quot;&gt; </FONT>
<FONT COLOR="#000000"> &lt;selector </FONT>
<FONT COLOR="#000000"> class=&quot;pam.general.constraints.ValidationDelegateCl ientSelector&quot;/&gt; </FONT>
<FONT COLOR="#000000"> &lt;/clientContext&gt;</FONT>
<FONT COLOR="#000000"> &lt;binding </FONT>
<FONT COLOR="#000000"> context=&quot;org.eclipse.emf.validation.pde.general.ui. libraryContext&quot; </FONT>
<FONT COLOR="#000000"> category=&quot;emf-validation-example/ocl&quot;/& ;gt; </FONT>
<FONT COLOR="#000000">&lt;/extension&gt;</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
Hmmm ... it looks like you are trying to define, on behalf of another plug-in, a client-selector for a context that the other plug-in defines.&nbsp; That is not permitted by the framework (though I think it isn't prevented; it just breaks stuff).&nbsp; I would expect this to cause erratic behaviour.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">I would like to point out also that OCL constraints declared in </FONT>
<FONT COLOR="#000000">plugins.xml are correctly handled only when an adapter is present. Is it </FONT>
<FONT COLOR="#000000">something agreed or has the examples been made in such a way ?</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
As I mentioned, this is a bug in the examples.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Last point, I would like to know why my custom OCL files provider is </FONT>
<FONT COLOR="#000000">considered whereas there is no binding for it.</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
A constraint provider will be invoked when it has no constraint-binding under either of two conditions:<BR>
<BR>
<UL>
<LI>the elements being validated do not match any defined client-context.&nbsp; These implicitly match constraints that are not bound to any context
<LI>the elements being validated match a client-context flagged as a &quot;default&quot; context.&nbsp; This is not recommended (it's for compatibility with an earlier release of the API, before contexts were introduced)
</UL>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>

<FONT COLOR="#000000">Thanks for your help,</FONT>

<FONT COLOR="#000000">Regards,</FONT>

<FONT COLOR="#000000">CLAVREUL Mickael.</FONT>

<FONT COLOR="#000000">Christian W. Damus wrote:</FONT>
<FONT COLOR="#000000">&gt; Hi, Micka&#235;l,</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; The constraint bindings mechanism is quite orthogonal to the constraint </FONT>
<FONT COLOR="#000000">&gt; providers, so perhaps the same category identifier used in your </FONT>
<FONT COLOR="#000000">&gt; plugin.xml constraint provider (which you say works) would have the same </FONT>
<FONT COLOR="#000000">&gt; problem?</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; I don't see anything obviously wrong with your provider XML. Can you </FONT>
<FONT COLOR="#000000">&gt; show me your constraintBinding extension, too?</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Try some breakpoints in the </FONT>
<FONT COLOR="#000000">&gt; org.eclipse.emf.validation.internal.service.ClientContextMan ager to </FONT>
<FONT COLOR="#000000">&gt; debug the association of your category with your client-context.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; HTH,</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Christian</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; P.S. - you aren't using the org.eclipse.emf namespace in your production </FONT>
<FONT COLOR="#000000">&gt; code, I hope? :-)</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; On Tue, 2008-07-08 at 09:58 +0200, Micka&#235;l CLAVREUL wrote:</FONT>
<FONT COLOR="#000000">&gt;&gt; Hi,</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; I've checked the entire mailing lists and newsgroup messages about that </FONT>
<FONT COLOR="#000000">&gt;&gt; particular point but I couldn't manage to find a solution to my problem.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; Let me explain, I am trying to augment the validation process with </FONT>
<FONT COLOR="#000000">&gt;&gt; several OCL constraints for a specific instance of a metamodel.</FONT>
<FONT COLOR="#000000">&gt;&gt; I've followed the tutorials on EMF Validation and Using OCL and from the </FONT>
<FONT COLOR="#000000">&gt;&gt; Library example I succeeded in creating my own constraints for the </FONT>
<FONT COLOR="#000000">&gt;&gt; validation.</FONT>
<FONT COLOR="#000000">&gt;&gt; From org.eclipse.emf.validation.examples.general and </FONT>
<FONT COLOR="#000000">&gt;&gt; org.eclipse.emf.validation.examples.ocl I have modified, embedded </FONT>
<FONT COLOR="#000000">&gt;&gt; contraints in the plugin.xml files are evaluated and I get adequate results.</FONT>
<FONT COLOR="#000000">&gt;&gt; Now I would like to declare OCL constraints as separate files and I took </FONT>
<FONT COLOR="#000000">&gt;&gt; from the tutorial the constraintsProvider definition, but I do not know </FONT>
<FONT COLOR="#000000">&gt;&gt; how to bind this new provider to my validation component because I do </FONT>
<FONT COLOR="#000000">&gt;&gt; not have any category identifier in this particular constraintsProvider </FONT>
<FONT COLOR="#000000">&gt;&gt; element.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; Could you help me a bit ?</FONT>
<FONT COLOR="#000000">&gt;&gt; Here is my constraintsProvider declaration (code is quite the same as </FONT>
<FONT COLOR="#000000">&gt;&gt; the tutorial one as I am trying to make it work first :)):</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &lt;extension</FONT>
<FONT COLOR="#000000">&gt;&gt; point=&quot;org.eclipse.emf.validation.constraintProvide rs&quot; </FONT>
<FONT COLOR="#000000">&gt;&gt; id=&quot;oclProvider&quot;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &lt;!-- Custom constraint provider using OCL documents --&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &lt;constraintProvider </FONT>
<FONT COLOR="#000000">&gt;&gt; class=&quot;org.eclipse.emf.validation.pam.ocl.OCLConstr aintProvider&quot; </FONT>
<FONT COLOR="#000000">&gt;&gt; category=&quot;Constraints from an OCL Document&quot;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &lt;package </FONT>
<FONT COLOR="#000000">&gt;&gt; namespaceUri=&quot; http:///org/eclipse/emf/examples/library/extlibrary.ecore/1. 0.1&quot;/&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &lt;ocl path=&quot;constraints/library.ocl&quot;/&gt;</FONT >
<FONT COLOR="#000000">&gt;&gt; &lt;/constraintProvider&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; &lt;/extension&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; So I tried to create a constraintsBinding element with the category </FONT>
<FONT COLOR="#000000">&gt;&gt; &quot;Constraints from an OCL Document&quot; but it doesn't seem to work.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; Thanks for your help.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; Regards,</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; CLAVREUL Mickael.</FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-/SRfJOsFra+ZbBi43QJZ--
Previous Topic:Notification of cahnges in proxy elements
Next Topic:CopyCommand broken?
Goto Forum:
  


Current Time: Thu Mar 28 17:22:11 GMT 2024

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

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

Back to the top