Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » problem with multiStatus
problem with multiStatus [message #31940] Wed, 04 July 2007 20:45
Eclipse User
Originally posted by: asma.charfi.com

Hi,
I tried to use EMF Validation to validate more than one constraint added to
one element (I ad my ocnstraits on stereotype)

I am using org.eclipse.emf.validation.examples.general In my class which
extends AbstractModelConstrain
I used ConstraintStatus.createMultiStatus(ctx,problems) method us
explained in the validate method detail.
When I run my plugin and click on the element the 2 constraints are checked
and I get 2 error messages as defined in ConstraintStatus.createStatus()
arguments.

I thought that it works and now I can validate more than one constraints,but
the problem is that when I click on the model (not only one element) I did
not get the good messages ( this constraints are violated by this element) I
got this:
"Some model constraints failed; see messages for details"
I did not understand why I get such message? (when I validate only one
constraint by element and click on the model it works perfectly)

thank you

asma
Re: problem with multiStatus [message #31982 is a reply to message #31940] Wed, 04 July 2007 13:40 Go to previous message
Eclipse User
Originally posted by: cdamus.ca.ibm.com

Hi, Asma,

Please use the EMF newsgroup (which I have included in this reply) for
questions about the EMF Validation framework; this is not an OCL problem.

The "Some model constraints failed" message is provided by the framework as
a generic message indicating that validation produced more than one
message. The message is generic because the framework doesn't know what
kind relationship there may or may not be between the constraints that
failed. It would seem that, when you validate the whole model, there are
other constraint violations being reported in addition to the one that you
are looking for.

Whenever the IValidator returns a multi-status, you will find that its
children are the statuses returned by your constraints. In particular, the
multi-status produced by your constraint is a child of this generic
message. Only in the (possibly rare) case that there is only a single
problem to report (or none at all) will the result of the IValidator not be
this generic multi-status.

HTH,

Christian


charfi asma wrote:

> Hi,
> I tried to use EMF Validation to validate more than one constraint added
> to one element (I ad my ocnstraits on stereotype)
>
> I am using org.eclipse.emf.validation.examples.general In my class which
> extends AbstractModelConstrain
> I used ConstraintStatus.createMultiStatus(ctx,problems) method us
> explained in the validate method detail.
> When I run my plugin and click on the element the 2 constraints are
> checked and I get 2 error messages as defined in
> ConstraintStatus.createStatus() arguments.
>
> I thought that it works and now I can validate more than one
> constraints,but the problem is that when I click on the model (not only
> one element) I did not get the good messages ( this constraints are
> violated by this element) I got this:
> "Some model constraints failed; see messages for details"
> I did not understand why I get such message? (when I validate only one
> constraint by element and click on the model it works perfectly)
>
> thank you
>
> asma
Previous Topic:Syntax helper for OCL undefined type
Next Topic:Parsing problem.
Goto Forum:
  


Current Time: Thu Jul 24 11:24:43 EDT 2014

Powered by FUDForum. Page generated in 0.02938 seconds