🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
OCLOperators multiplication
This page was created by Charles on 2025-11-18. Last edited by Restore-user on 2026-10-21.

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 * b

a 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.BonusPerEmployee

Using Multiplication with a collection

Department.allInstances
  ->collect(d | d.EmployeeCount * d.BonusPerEmployee)