Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Validating superclass constraints in OCL
Validating superclass constraints in OCL [message #694240] Fri, 08 July 2011 07:32 Go to next message
Wilbert Alberts is currently offline Wilbert Alberts
Messages: 94
Registered: June 2010
Member
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 14:30 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4110
Registered: July 2009
Senior Member
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 Oct 30 14:46:26 GMT 2014

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

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