This article provides a comprehensive guide on using all the Conversion functions available in Decision Model and Notation (DMN). These functions are essential for modelling business decisions using DMN.
DMN Conversion Functions Reference
| Function | Parameters | Example | Result | Purpose |
|---|---|---|---|---|
| number (from, grouping separator, decimal separator) | from (string): a number in the form of a string with grouping consisting of a space (‘ ‘), comma (‘ ,‘), period (‘,’), or null (Mandatory) grouping separator (string): a period, comma, or null, but not be the same as the decimal separator unless both are null (Mandatory) decimal separator (string): a period, comma, or null, but SHALL NOT be the same as the grouping separator unless both are null (Mandatory) | number(“1,000.0”, “,”, “.”) | 1000 | Convert from to a number. |
| years and months duration (from, to) | from, to (both are date or both are date and time): dates separated by a comma (‘ ,‘) (Mandatory) | years and months duration(date(“2011-12-22”),date(“2013-08-24”)) | P1Y8M | Return years and months duration between two given dates (from and to). |
| time (from) | from (string): DMN valid time format, date and time format, or hour:minute:second±(offset in days time duration)(Mandatory) | time(“23:59:01.987654321”) + duration(“PT2M”) | 00:01:01.987 | Converts from to time (ignoring date components) |
| date (from) | from (string): DMN valid date format or date and time format (Mandatory) | date(date and time(“2012-12-25T1:00:00Z”)) | 2012-12-25 | Converts from to date (ignoring time components) |
| duration (from) | from (string): DMN valid days and time or years and months (Mandatory) | (date and time(“2012-12-24T23:59:00”) – date and time(“2012-12-22T03:45:00”)) == duration(“P2DT20H14M”) | true | Returns the size of a list– if the list is empty zero is returned. |
| date and time (from) | from (date and time string): DMN valid date and time or with two arguments: date (or date and time) and time (Mandatory) | date and time(“2012-12-25T00:00:00”) | 2012-12-25T00:00:00 | Converts from to a date and time. Also, creates a date time from the given date (ignoring any time component) and the given time. |

