FEEL

function definition

FEEL language construct

function(param, param) expression

FEEL supports inline function definitions; functions are values and can be stored in a context entry and called by that name. This keeps a repeated sub-expression in one place inside a single literal expression, without needing a separate decision.

Syntax elements

ElementTypeDescription
paramnameparameter name, optionally with a type: name: number
expressionanythe body; parameters are in scope

Examples

(function(a, b) a + b)(2, 3)
{ add: function(a,b) a + b, r: add(2,3) }.r
{ vat: function(net) net * 0.081, total: 100 + vat(100) }.total

Related constructs

context literal {…} · for … in … return

Defined by the OMG DMN 1.6 specification, chapter 10.3 (the FEEL grammar and semantics).