Supported Data Types
The following types are supported by the DMN engine:| Data Type | Can transform from | Produce values of type |
|---|---|---|
| string | java.lang.Object | StringValue |
| boolean | java.lang.Boolean, java.lang.String | BooleanValue |
| integer | java.lang.Number, java.lang.String | IntegerValue |
| long | java.lang.Number, java.lang.String | LongValue |
| double | java.lang.Number, java.lang.String | DoubleValue |
| date | java.util.Date, java.lang.String, java.time.LocalDateTime, java.time.ZonedDateTime | DateValue |
Working with Dates
The DMN engine supports adate type which is a combination of date and time.
By default, the data type transformer accept objects of the types:
java.util.Date- Strings having the format
yyyy-MM-dd'T'HH:mm:ss java.time.LocalDateTimejava.time.ZonedDateTime
Setting the Data Type of an Input
The type of a decision table input is specified by thetypeRef attribute on the
inputExpression element.
Setting the Data Type of an Output
The type of a decision table output is specified by thetypeRef attribute on the output
element.
Setting the Data Type of a Variable
The type of a decision literal expression result is specified by thetypeRef attribute on the variable
element.
Implement a Custom Data Type
The default data types of the DMN engine can be extended or replaced by custom types. For example, you can add a new type for time or change the transformation to support a different date format or localized boolean constants. To do this, implement a new DmnDataTypeTransformer. The transformation is processed in thetransform() method and returns a typed value. If it cannot successfully transform a value,
it must throw an IllegalArgumentException.