Issue 7466: rewrite well-formedness (ocl2-rtf) Source: OpenModeling (Mr. Jos Warmer, jos.warmer(at)openmodeling.nl) Nature: Uncategorized Issue Severity: Summary: We would like to be able to rewrite well-formedness rules like: context IfExp inv: self.condition.type.oclIsKindOf(Primitive) and self.condition.type.name = ’Boolean’ as context IfExp inv: self.condition.type.oclIsKindOf(Primitive) and This is more clear that the first expression where the matching is done by name. Because the metamodel resides on a level higher than the standard library, we need a way to get access to the standard library elements. One solution is to define a package ’StandardLibrary’ that contains a Classifier called ’StdLib’, that holds the following attributes: • + Collection: CollectionType; • + Set: SetType; • + OrderedSet: OrderedSetType; • + Sequence: SequenceType; • + Bag: BagType; • + String: Primitive; • + OclMessage: OclMessageType; • + OclVoid : VoidType; Other solutions might be possible, but the above has been proven to work in the Octopus tool. Resolution: Unfortunately the 'better' example is missing from the above text. Presumably it should read: context IfExp inv: self.condition.type.oclIsKindOf(Primitive) and self.condition.type = StdLib::Boolean OCL supports type literal as in a.oclIsKindOf(Boolean) so the 1.x practice of comparing types by string-valued name was a misunderstanding. It is possible to write inv: self.condition.type.oclIsKindOf(Primitive) and self.condition.type = Boolean Disposition: Closed, no change Revised Text: Actions taken: June 10, 2004: received issue December 23, 2013: closed issue Discussion: Discussion: This issue will be deferred. There is a question of representing formally the standard library as an ordinary UML package, which is not going to be solved for OCL 2.1 release. Disposition: Deferred End of Annotations:===== s is issue # 7466 rewrite well-formedness We would like to be able to rewrite well-formedness rules like: context IfExp inv: self.condition.type.oclIsKindOf(Primitive) and self.condition.type.name = .Boolean. as context IfExp inv: self.condition.type.oclIsKindOf(Primitive) and This is more clear that the first expression where the matching is done by name. Because the metamodel resides on a level higher than the standard library, we need a way to get access to the standard library elements. One solution is to define a package .StandardLibrary. that contains a Classifier called .StdLib., that holds the following attributes: . + Collection: CollectionType; . + Set: SetType; . + OrderedSet: OrderedSetType; . + Sequence: SequenceType; . + Bag: BagType; . + String: Primitive; . + OclMessage: OclMessageType; . + OclVoid : VoidType; Other solutions might be possible, but the above has been proven to work in the Octopus tool.