OCLOperators less than
This page was created by Charles on 2025-11-18. Last edited by 62.169.16.147 on 2026-09-12.
Symbol (<)[edit source]
The < operator is a comparison operator used to check whether the value on the left-hand side is strictly less than the value on the right-hand side. It evaluates to a Boolean result (true or false) and is commonly used in OCL constraints, validations, and conditional expressions.
Example:
Assume the Department class has an attribute called EmployeeCount.
self.EmployeeCount < 10What this means[edit source]
- The Department must have fewer than 10 employees
- If EmployeeCount is less than 10, the expression returns True
- If it is 10 or more, it returns false
Using a Collection
Department.allInstances->exists(d | d.Score < 10)Results
