OCLOperators greater than
Created by Charles on 2025-11-18 · Last edited by Colline.ssali on 2026-01-28.
Symbol (>)
The > operator is a comparison operator used to determine whether the value on the left-hand side is strictly greater than the value on the right-hand side. It evaluates to a Boolean result (true or false) and is commonly used in OCL constraints and validation rules.
Example:
Assume the Department class has an attribute called EmployeeCount.
self.EmployeeCount > 0The department must have more than zero employees. If EmployeeCount is greater than 0, the expression returns true, else it returns false.
Using the greater than operator on collection
Department.allInstances->exists(d | d.EmployeeCount > 10)Results:
