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 goes:<br><br>In my cute little test case I have the attached class diagram.<br><br>
The Level object has an attached constraint to make sure there is only one Boss-type object in the model:<br><br>self.parts( Boss )->size == 1 <br> <br>This is checked for "On new child".<br><br>The Boss object has a constraint as follows, so its "Number" attribute can only be 1:
<br><br>self.Number == 1<br><br>This is checked for "On change attribute"<br><br>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
<br>OCL syntax issue. Can anyone tell me what I'm missing?<br><br>Thanks,<br>-Joe<br><br>