OCLOperators not equal to
Created by Charles on 2025-11-18 · Last edited by Colline.ssali on 2025-12-31.
Symbol (<>)
The <> operator is a comparison operator used to check whether two values are not equal. It returns a Boolean result (true or false) and is commonly used in OCL constraints and validation rules.
Assume the Department class has an attribute called DepartmentName.
Department.allInstances->forAll(d | d.DepartmentName <> 'Projects')Results:
The expression returns true only if the Department class does not have a Projects record.
