Skip to main content



      Home
Home » Modeling » OCL » Validating superclass constraints in OCL
Validating superclass constraints in OCL [message #694240] Fri, 08 July 2011 03:32 Go to next message
Eclipse UserFriend
Hi,

I created an OCL document containing invariants against a certain metamodel. The meta model contains a class Foo and a class Bar which is derived from Foo. (So Bar inherits from Foo.)

When I create a model (according to the meta model) and I let the CompleteOCLEObjectValidator perform the validations, it turns out that given a constraint for Foo, any object of type Bar is not validated.

To make it specific.

The metamodel:

package zoo : zoo = 'http://zoo.walb.com'
{
	class Foo
	{
		attribute name : String[?] { ordered };
	}
	class Bar extends Foo
	{
		attribute id : String[?] { ordered };
	}
}


The ocl document:

import 'http://zoo.walb.com'

package zoo

context Foo
inv AlwaysFalseFoo: false

endpackage


I would expect that when I validate a model containing a Bar object, that the validator would indicate that the AlwaysFalseFoo constraint is not fulfilled.

Am I misunderstanding the OCL specification or did I trigger a bug in the tool?

Greetings,
Wilbert.

Re: Validating superclass constraints in OCL [message #694417 is a reply to message #694240] Fri, 08 July 2011 10:30 Go to previous message
Eclipse UserFriend
Hi Wilbert
> or did I trigger a bug in the tool?
>
Yeah. A pretty simple one too:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=351578: should be fixed in
SR1. Thanks for the repro.

Regards

Ed Willink
Previous Topic:Unable to perform OCL validation outside eclipse
Next Topic:OCL Interactive Query fails for large file
Goto Forum:
  


Current Time: Thu Jun 19 00:22:41 EDT 2025

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

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

Back to the top