🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators less than
Created by Charles on 2025-11-18 · Last edited by Colline.ssali on 2026-01-29.

Symbol (<)

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 < 10
What this means
  • 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

Documentation OCLOperators less than 1769683356357.png