Constraint Descriptor : rmim025 (type: ERROR, kind: )

Constraint : rmim025

Constraint Name
rmim025 (type: ERROR, kind: )
Constraint Class
RegionOfInterestSpec
Package
cdabasic
Description
A RegionOfInterest must reference exactly one ObservationMedia or one ExternalObservation (RMIM-025)
OCL
(
	self.entryRelationship->select(entr : POCDMT000040EntryRelationship| 
		(not entr.typeCode.oclIsUndefined()) and 
		entr.typeCode=XActRelationshipEntryRelationship::SUBJ and 
		(not entr.observationMedia.oclIsUndefined())
	)->size()>0 or 
	(
		(not self.__parent.oclIsUndefined()) and 
		self.__parent.oclIsKindOf(POCDMT000040EntryRelationship) and 
		(not self.__parent.oclAsType(POCDMT000040EntryRelationship).typeCode.oclIsUndefined()) and 
		self.__parent.oclAsType(POCDMT000040EntryRelationship).typeCode=XActRelationshipEntryRelationship::SUBJ and 
		(not self.__parent.oclAsType(POCDMT000040EntryRelationship).inversionInd.oclIsUndefined()) and 
		self.__parent.oclAsType(POCDMT000040EntryRelationship).inversionInd=true and 
		(not self.__parent.oclAsType(POCDMT000040EntryRelationship).__parent.oclIsUndefined()) and 
		self.__parent.oclAsType(POCDMT000040EntryRelationship).__parent.oclIsKindOf(POCDMT000040ObservationMedia)
	)
) xor 
(
	self.reference->select(ref : POCDMT000040Reference | 
		(not ref.externalObservation.oclIsUndefined())
	)->size()>0
)