OCLOperators multiplication
Created by Charles on 2025-11-18 · Last edited by Colline.ssali on 2026-01-25.
Symbol (*)
In OCL, the multiplication operator (*) is an arithmetic operator used to multiply two numeric values. It is commonly used in calculations, derived attributes, and constraints. The result is a numeric value (Integer or Real, depending on the operands)
Basic Syntax
a * ba is the first factor
b is the second factor
Assume the Department class has:
- EmployeeCount: Integer
- BonusPerEmployee: Double
Calculate total Total Bonus
self.EmployeeCount * self.BonusPerEmployeeUsing Multiplication with a collection
Department.allInstances
->collect(d | d.EmployeeCount * d.BonusPerEmployee)