[gme-users] Using OCL
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).
Senior Research Scientist,
Institute of Software Integrated Systems, Vanderbilt University
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
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
OCL syntax issue. Can anyone tell me what I'm missing?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gme-users