Commit 7f04a993 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ distinguish error/warning in OCL, example in parameter binding, #109

parent b06642ee
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -2,6 +2,13 @@ import 'http://www.etsi.org/spec/TDL/1.4.1'


package tdl
package tdl


context Element
	def: error(constraint : Boolean) : Boolean = 
		if constraint then true else null endif
	def: warning(constraint : Boolean) : Boolean = 
		if constraint then true else false endif


context NamedElement
context NamedElement
  -- Mandatory name
  -- Mandatory name
  inv MandatoryName ('A \'NamedElement\' shall have the \'name\' property set and the \'name\' shall be not an empty String.' + self.toString()):
  inv MandatoryName ('A \'NamedElement\' shall have the \'name\' property set and the \'name\' shall be not an empty String.' + self.toString()):
@@ -296,7 +303,7 @@ context DataUse
context ParameterBinding
context ParameterBinding
  -- Matching data type
  -- Matching data type
  inv ParameterBindingTypes ('The provided \'DataUse\' shall conform to the \'DataType\' of the referenced \'Parameter\'.' + self.toString()):
  inv ParameterBindingTypes ('The provided \'DataUse\' shall conform to the \'DataType\' of the referenced \'Parameter\'.' + self.toString()):
        self.dataUse.resolveDataType().conformsTo(self.resolveParameterType())
        error(self.dataUse.resolveDataType().conformsTo(self.resolveParameterType()))
        
        
  -- Members in 'reduction' list of parameter
  -- Members in 'reduction' list of parameter
  inv ReductionMembers ('The \'Member\' referenced by the \'MemberReference\' at index i of a \'reduction\' shall be contained in or inherited by the \'StructuredDataType\' of the \'Member\' referenced by the \'MemberReference\' at index (i - 1) of that \'reduction\' or the \'StructuredDataType\' of the \'parameter\' if the \'MemberReference\' is the first element of the \'reduction\'.' + self.toString()):
  inv ReductionMembers ('The \'Member\' referenced by the \'MemberReference\' at index i of a \'reduction\' shall be contained in or inherited by the \'StructuredDataType\' of the \'Member\' referenced by the \'MemberReference\' at index (i - 1) of that \'reduction\' or the \'StructuredDataType\' of the \'parameter\' if the \'MemberReference\' is the first element of the \'reduction\'.' + self.toString()):