| [news.eclipse.modeling.mdt.uml2.ocl] How to validate uniqueness of class names within an entire package subtree |
Andy
Hi, Andy,
Try this constraint in the context of the package that is the common root:
Class.allInstances()->select( allNamespaces()->includes(self))->isUnique(name)
HTH,
Christian
Andreas Maier wrote:
In CIM, the names of all classes (and association classes)in the CIM schema must be unique. The classes in the CIM schema are located in a package subtree of mostly depth 3, starting from a common root. There are about 1600+ classes and association classes. There are no other classes in that package subtree.
I want to write an OCL constraint that validates that all those class names are in fact unique as described above.
Any ideas how to do that ?
Andy