FEEL

partition

FEEL built-in function · FEEL list functions

partition(list, size)

Not part of the DMN 1.6 standard: an extension supported by the engine behind this site. A model that uses it may not run on other DMN engines.

Splits the list into consecutive chunks of the given size; the last chunk may be shorter.

Parameters

ParameterTypeDescription
listlistthe source list
sizenumbermaximum chunk size, a positive integer

Examples

partition([1, 2, 3, 4, 5], 2)
[[1, 2], [3, 4], [5]] Try it ↑

Edge cases and null handling

partition([1, 2, 3], 0)

The size must be positive.

Related functions

sublist · flatten

Not defined by the OMG DMN 1.6 specification; documented here because the engine behind this site supports it.