[gme-users] Using OCL

Sandeep Neema sandeep.neema at vanderbilt.edu
Tue Aug 8 14:52:21 CDT 2006


One thing that I notice here is your use of the '==' comparison
operator. Someone else can give you a better explanation, but in OCL you
use '=' for value comparison (OCL does not have an assignment operator).






Sandeep Neema

Senior Research Scientist,

Institute of Software Integrated Systems, Vanderbilt University

Phone: 615-343-9996

Email: sandeep.k.neema at vanderbilt.edu


From: gme-users-bounces at list.isis.vanderbilt.edu
[mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Joe
Sent: Tuesday, August 08, 2006 12:46 PM
To: gme-users
Subject: [gme-users] Using OCL


My understanding of OCL is apparently very thin.  I have two examples,
but I suspect I'm making the same kind of mistake for both, so here

In my cute little test case I have the attached class diagram.

The Level object has an attached constraint to make sure there is only
one Boss-type object in the model:

self.parts( Boss )->size == 1 
This is checked for "On new child".

The Boss object has a constraint as follows, so its "Number" attribute
can only be 1: 

self.Number == 1

This is checked for "On change attribute"

For either contraint the warnings show all of the time for the two
events, whether or not the constraint is true.    I realize it's most
likely an 
OCL syntax issue.  Can anyone tell me what I'm missing?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20060808/1db1418c/attachment.htm

More information about the gme-users mailing list