OCLOperators multiplication
This page was created by Charles on 2025-11-18. Last edited by 62.169.16.147 on 2026-09-12.
Symbol (*)[edit source]
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)