Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCLConstraintProvider customization
OCLConstraintProvider customization [message #50201] Fri, 01 February 2008 13:41 Go to next message
wong is currently offline wongFriend
Messages: 54
Registered: July 2009
Member
Hello,

My question is continuing on the following:
http://www.eclipse.org/newsportal/article.php?id=1045&gr oup=eclipse.modeling.mdt.ocl#1045

The getConstraints() of ModelValidationService seems only be called once.
I am still not find a way to update the constraintCache inside the
ModelValidationService.

I tried to write a my own ModelValidationService, but it need the elements
to configureProviders(IConfigurationElement[] elements).

I want users can change the .ocl file to do validation again without
restart the eclipse.
Could you tell me is there any way to do it Or it not impossible at moment.


Thank you in advance.
wong.
Re: OCLConstraintProvider customization [message #50262 is a reply to message #50201] Fri, 01 February 2008 14:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Wong,

In my reply on that other thread, I said:

-----8<-----

If your provider is registered in the plugin.xml using cache="false" in the
<constraintProvider> element, then the framework should not be adding it to
the ConstraintCache provider that caches constraints.

If this is happening to your provider, then that is a severe bug. In that
case, a bugzilla with a reproducible test case would be much appreciated.

----->8-----

Cheers,

Christian


wong wrote:

> Hello,
>
> My question is continuing on the following:
>
http://www.eclipse.org/newsportal/article.php?id=1045&gr oup=eclipse.modeling.mdt.ocl#1045
>
> The getConstraints() of ModelValidationService seems only be called once.
> I am still not find a way to update the constraintCache inside the
> ModelValidationService.
>
> I tried to write a my own ModelValidationService, but it need the elements
> to configureProviders(IConfigurationElement[] elements).
>
> I want users can change the .ocl file to do validation again without
> restart the eclipse.
> Could you tell me is there any way to do it Or it not impossible at
> moment.
>
>
> Thank you in advance.
> wong.
Re: OCLConstraintProvider customization [message #50292 is a reply to message #50262] Fri, 01 February 2008 16:01 Go to previous messageGo to next message
wong is currently offline wongFriend
Messages: 54
Registered: July 2009
Member
Hello Christian,

I think I did not say it very clearly. I just add cache="false" on
following which is your ocl example, it does not work for me.

I want uses are able to update the *.ocl file in the eclipse runtime from
the example of '<!-- Custom constraint provider using OCL documents -->'

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

<!-- Custom constraint provider using OCL documents -->
<constraintProvider

class=" org.eclipse.emf.validation.examples.ocl.OCLConstraintProvide r "
category="Constraints from an OCL Document"
cache="false">

<package
namespaceUri=" http:///org/eclipse/emf/examples/library/extlibrary.ecore/1. 0.0"/>

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

Thank you very much.

Wong.
Re: OCLConstraintProvider customization [message #50322 is a reply to message #50262] Fri, 01 February 2008 18:19 Go to previous messageGo to next message
wong is currently offline wongFriend
Messages: 54
Registered: July 2009
Member
Hello, Christian.

I got it works. Thank you so much.

All my bad. I set the inv name started with digit. So it did not work.
"inv 1rule: self.courseGoals->notEmpty()"

I really appreciate your help.

Thank you very much.

Wong.
Re: OCLConstraintProvider customization [message #50346 is a reply to message #50322] Fri, 01 February 2008 18:28 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Wong,

Good! I'm glad it's working for you, now.

I think this problem with the initial digit is probably more of an issue in
the parser grammar than it is a violation of any naming rules in OCL/UML
(there generally aren't any). Probably not worth worrying about :-)

cW

wong wrote:

> Hello, Christian.
>
> I got it works. Thank you so much.
>
> All my bad. I set the inv name started with digit. So it did not work.
> "inv 1rule: self.courseGoals->notEmpty()"
>
> I really appreciate your help.
>
> Thank you very much.
>
> Wong.
Previous Topic:Getting Started
Next Topic:[Announce] MDT OCL 1.2.0 I200802062000 is available
Goto Forum:
  


Current Time: Tue Apr 23 10:33:44 GMT 2024

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

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

Back to the top