FEEL context functions
5 built-in functions · DMN 1.6
Functions over FEEL contexts, the key/value records written as {name: value, …}. They read entries dynamically and build modified copies without mutating the original.
All FEEL context functions at a glance
| Function | Signature | Returns |
|---|---|---|
| get value | get value(context, key) | Returns the value of the named entry, or null if the key does not exist |
| get entries | get entries(context) | Returns the context as a list of {key, value} pairs, enabling iteration over entries |
| context | context(entries) | Builds a context from a list of {key, value} pairs, the inverse of get entries |
| context put | context put(context, keys, value) | Returns a copy of the context with the entry set, added or replaced |
| context merge | context merge(contexts) | Combines a list of contexts into one; later entries overwrite earlier ones with the same key |
Function reference
Each function with its parameters, examples and edge cases.
get value
get value(context, key)
Returns the value of the named entry, or null if the key does not exist. Useful when the key is only known at runtime.
| Parameter | Type | Description |
|---|---|---|
| context | context | the context to read |
| key | string | the entry name |
get value({foo: 123}, "foo")
get value({foo: 123}, "bar")
Related: get entries · context put
get entries
get entries(context)
Returns the context as a list of {key, value} pairs, enabling iteration over entries.
| Parameter | Type | Description |
|---|---|---|
| context | context | the context to expand |
get entries({foo: 123, bar: 456})
context
context(entries)
Builds a context from a list of {key, value} pairs, the inverse of get entries.
| Parameter | Type | Description |
|---|---|---|
| entries | list of contexts | a list of {key, value} pairs |
context([{key: "a", value: 1}, {key: "b", value: 2}])
Related: get entries · context put · context merge
context put
context put(context, keys, value)
Returns a copy of the context with the entry set, added or replaced. A list of keys addresses a nested entry path.
| Parameter | Type | Description |
|---|---|---|
| context | context | the source context |
| keys | string or list of strings | entry name, or a path of names for nested contexts |
| value | any | the value to set |
context put({x: 1}, "y", 2)
context put({x: {y: 1}}, ["x", "y"], 2)
Related: context merge · get value
context merge
context merge(contexts)
Combines a list of contexts into one; later entries overwrite earlier ones with the same key.
| Parameter | Type | Description |
|---|---|---|
| contexts | list of contexts | the contexts to combine, in order |
context merge([{x: 1}, {y: 2}, {x: 3}])
Related: context put · context
How B-FEEL differs
In standard FEEL an invalid argument makes the result null. The business-friendly
B-FEEL dialect returns a type default instead. Both columns were evaluated by the same engine:
| Expression | FEEL | B-FEEL |
|---|---|---|
| get entries(null) | null | [] |
| {a: 1}.b + 1 | null | 1 |
More FEEL guides
FEEL string functions · FEEL numeric functions · FEEL list functions · FEEL date and time functions · Language constructs · Examples cheat sheet
Defined by the OMG DMN 1.6 specification, chapter 10.3.4 (built-in functions).