Hi - we are interested in applying OCL in some UML models that serve the pupose of specification. Therefore, more formality is better. Henceforth, OCL would be nice to apply here.
To get started, I grabbed a copy of
http://www.amazon.com/gp/product/0321179366/ and I re-created the sample class model in the book for the "Royal & Loyal" example (Chapter 2). The class diagram looks like this:

-- taken from this website:
http://maude.sip.ucm.es/itp/ocl/examples.htmlI re-drew this in EA as a class diagram, and tried adding my own OCL constraints to it, and then doing model validation.
For example, I added this OCL constraint:
context LoyaltyProgram
inv minServices: partners.deliveredServices->size() >= 1However, in EA, you do this by opening the Properties page of the LoyaltyProgram class, hitting the Constraints tab...then adding a new Constraint of Type OCL. In the Constraint box, I typed the name
minServices, and in the box that follows I typed:
inv minServices: partners.deliveredServices->size() >= 1
You don't need to have the
context LoyaltyProgram
part because this is implied via the GUI. In fact if you add the context part, it fails OCL validation.
So, when I hit Save, a box pops up and tells me "OCL validation Successful" -- seemingly indicating to me that the OCL syntax is correct.
However, if I select the LoyaltyProgram class, and do CTRL+ALT+V (do model validation on this element), it reports to me:
MVR040001 - warning (LoyaltyProgram (Class)): OCL violation: inv minServices: partners.deliveredServices->size() >= 1
So, it is giving me a warning that this is in violation of the constraint. Two things I don't understand here:
1. Why is this in violation?
2. If it is in violation (which I don't believe it is), why is this a warning and not an error?