🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators maxValue
This page was created by Lars.olofsson on 2020-01-07. Last edited by Wikiadmin on 2026-07-29.

You can use maxValue in OCL when you need the highest value in a collection of simple value objects.

What maxValue returns

maxValue returns the highest (maximum) value from a collection of simple value objects.

For example, if a collection contains the values 12, 24, and 18, maxValue returns 24.

When to use it

Use maxValue when your expression already produces a collection and you need its largest value.

For example, a collection of measured values can use maxValue to identify the greatest measurement rather than processing every value individually.

Related operators

maxValue finds the greatest value in a collection. To find the lowest value in a collection, use minValue.

To compare two numbers, use Number::max ( r : Number ) : Number instead.

See also