DMN date as INPUT

Hi, I’ve a case where I have a decision table in the BPMN process where Date (service month) is one of the inputs. The input is given in Json Format.

{“group”:“Group_A”,
“serviceMonth”:“2023-01-01”}
The output is always null. Not able figure out the issue.


image

If I change the input format to string and enter month as string, I’m able to get the output for this Json input:
{“group”:“Group_A”,
“serviceMonth”:“Jan”}

I’m not able to figure out why the output is null with the input as date format.

Maybe the input Expression should be defined as “date(serviceMonth)”. Because your original variable serviceMonth from the json is likely type of String. But the 2nd input of your DMN table is defined as a date.

When you tried to feed the date of type String into the dmn input of type Date, the actual input value of the dmn table would be a null.

2 Likes

Thank you for the suggestion. I tried, but I was unable to get the desired result. However, I tried the other way around. In the DMN tables, instead of (>date(“2015-01-01”)), it wrote as (>“2015-01-01”). I applied the same adjustment to the date range and got the expected.

Using the DMN Simulator with the attached DMN, I was able to make it work…
simulation.dmn (3.4 KB)

Group: GroupA (no quotes) & ServiceDate: 2023-12-18 17:15:00 → TypeA
Group: GroupB (no quotes) & ServiceDate: 2023-12-18 17:15:00 → Unknown5

This would allow the input in multiple different date formats, while your solution will be stuck to a particular string date format…

1 Like

Hi GotnOGuts, I got you on different formats. I’ve integrated the DMN decision table with BPMN model and deployed it. While running the instance I need to give input in a Json format. {“group”:“Group_A”,
“serviceMonth”:“2023-01-01”} where date should be in a string format. Try executing the below model with two different inputs:
{“group”:“Group_A”, “serviceMonth”:“2023-01-01”} → Type A
{“group”:“Group_A”, “serviceMonth”:“2017-01-01”} → Null

determine-type.dmn (2.3 KB)
new-bpmn-diagram.bpmn (3.1 KB)

It looks like the DMN engine requires TIME as well… if you try to simulate the decision with date only, it will complain.

1 Like