🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
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:

Documentation OCLOperators not equal to 1767177430268.png






The expression returns true only if the Department class does not have a Projects record.