Does anyone manage to check OCL constraints on a class diagram modeled in Eclipse Papyrus ? I have definied a simple test profile with only one constraint on a stereotype attribute :
{OCL} self.property > 0
The stereotype extends the Property metaclass so I applied it on a class attribute and I set the property of the stereotype to 0. But I never got an error with the Validation > Validate Model command from the context menu.
Any help would be much appreciate.
Thanks by advance.
I answer to myself for other people who might have the same problem.
OCL constraints checking doesn't work for Papyrus 0.9.x You have to download the latest nighlty build of OCL and Papyrus.
You can download them from these repositories :
- http://download.eclipse.org/modeling/mdt/papyrus/updates/nightly/kepler/
- http://download.eclipse.org/modeling/mdt/ocl/updates/nightly
Please notice that you have to use Eclipse Kepler and not Juno.
来源:https://stackoverflow.com/questions/15897583/ocl-constraints-checking-on-eclipse-papyrus