Follwing another post:
I would like to know if OCL allows the following.
Imagine the following UML diagram.
How to use ocl to model: "a person can drinkWater() only if he is from country name 'ABCD'" AND if the population of the country is >= 1000000"
Of course, the example is purely fictive.
================ ================
| Person | | Country |
|--------------| |--------------|
|- name |------------------|- id |
|- age | |- name |
|--------------| |- population |
|+ drinkWater()| ================
|+ drinkBeer() |
================