I’m working on a decision model using DMN JS to calculate the age based on a birthdate (dateDeNaissance) in a DMN table. However, I’m encountering a problem where the expression is returning null. I also tried using a literal expression, but it similarly returned null.
Error Details:
Expressions Used:
Literal Expression:
year(years and months duration(date(dateDeNaissance), now()))
Hi @OUSSAMA_TAYARI_0
I’m not an expert on the topic but I think there are two issues for the Expressions Used.
1 - The conversion function should be date and time because your input is in the data and time format
2 - year should be years
Try it like the following: (years and months duration(date and time(dateDeNaissance), now())).years
The playground is really useful for understanding what’s going on.
It will turn out errors (like
* [FUNCTION_INVOCATION_FAILURE] Failed to invoke function 'date': Failed to parse date from '2023-10-11T12:00:00+01:00'
* [FUNCTION_INVOCATION_FAILURE] Failed to invoke function 'years and months duration': Illegal arguments: 'null', '2024-11-04T16:47:45.247119038@Etc/UTC'