Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » How to retrieve a AbstractConstraintProvider Object.
How to retrieve a AbstractConstraintProvider Object. [message #30494] Tue, 26 June 2007 13:22 Go to next message
Eclipse UserFriend
Originally posted by: firstname.name.gmail.com

Hello,

I am going "further" in my OCL/UML validation. I can successfully parse
constraints and make multi-status reports. I am happy with that, but I would
like to be able to evaluate rules defined in a file.

I worked around the OCLConstraintProvider.

My main problem is that ocl file name is "hard-coded" by means of a plugin value
and in turn, I do not know how I may delete/add new ocl rules. I have tried to
deal with that by retrieving the OCLConstraintProvider object, in the
BatchValidationDelegate Class with the IBatchValidator validator to reinitialize
datas. But I didn't manage to get this object.

Anyway It seems to be not really a nice way to reinitialize values. So my
question is to know what is the best way (if there is one) to do that.

thanks.

--
F. Lagarde
Re: How to retrieve a AbstractConstraintProvider Object. [message #30668 is a reply to message #30494] Tue, 26 June 2007 14:56 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, François,

If you don't want the OCL file name to be hard-coded, it doesn't have to be.
The OCLConstraintProvider in the example is just that: an example. You
can define a provider that finds OCL files in a user's workspace next to
his UML models, if that is what you need.

Are you trying to react to a user's edits in an OCL file? Perhaps you need
to track, for each constraint that your provider defines (via the
constraint descriptor, probably), the OCL file that it came from. Then,
when the users changes that file, you can invalidate all of the descriptors
that originated from it and purge the constraint objects, too.

Note that constraints can be removed from the EMF Validation Framework by
using the ConstraintRegistry::unregister(IConstraintDescriptor) API.

The EMF Validation Framework provides no means by which a client can
directly access its constraint providers.

HTH,

Christian


François Lagarde wrote:

> Hello,
>
> I am going "further" in my OCL/UML validation. I can successfully parse
> constraints and make multi-status reports. I am happy with that, but I
> would like to be able to evaluate rules defined in a file.
>
> I worked around the OCLConstraintProvider.
>
> My main problem is that ocl file name is "hard-coded" by means of a plugin
> value and in turn, I do not know how I may delete/add new ocl rules. I
> have tried to deal with that by retrieving the OCLConstraintProvider
> object, in the BatchValidationDelegate Class with the IBatchValidator
> validator to reinitialize datas. But I didn't manage to get this object.
>
> Anyway It seems to be not really a nice way to reinitialize values. So my
> question is to know what is the best way (if there is one) to do that.
>
> thanks.
>
Previous Topic:OCL Interpreter Example
Next Topic:OCL query
Goto Forum:
  


Current Time: Sat Apr 20 04:31:52 GMT 2024

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

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

Back to the top