DMN Engine returns wrong values

I want to check whether a date is more than 30 days in the past. This works in FEEL-Playground with the following expression:
years and months duration(date(date1), today()).months * 31 + years and months duration(date(date1), today()).years * 365

That works.

I enter this expression in exactly the same way for the check in the decision table in Camunda. I save the exact result in ‘duration’. When I send the payload in the request body, I only get an integer value and ‘0’ as a response instead of the expected ‘4’. What could be the reason for this?

Request Body:


DMN file:
diagram_1.dmn (2.5 KB)

Hi @fabiannaether,

The below simple expression can be used:
(today() - date(date1)).days

And make sure to pass the date value in the correct format (YYYY-MM-DD)

1 Like

@hassang Can you please attach your DMN file?

This is an updated version of yours

diagram_1.dmn (2.4 KB)