Skip to main content

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 AlbertsFriend
Messages: 169
Registered: June 2010
Senior Member

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 = ''
	class Foo
		attribute name : String[?] { ordered };
	class Bar extends Foo
		attribute id : String[?] { ordered };

The ocl document:

import ''

package zoo

context Foo
inv AlwaysFalseFoo: false


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?


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 WillinkFriend
Messages: 5893
Registered: July 2009
Senior Member
Hi Wilbert
> or did I trigger a bug in the tool?
Yeah. A pretty simple one too: should be fixed in
SR1. Thanks for the repro.


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

Current Time: Sat May 26 16:03:11 GMT 2018

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

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

Back to the top