DMN Date Elegance

Hi,
I have a use case where I have some DMN rules where a service date must fall in a range for the rule to fire. The date will typically arrive in a Json structure;

{
“serviceDate” : “01-01-2021”;
}

In my ideal DMN table, I would like an elegant solution such as this;
Ideal

Im struggling with string to date (type) conversion and to get a basic working version, I have an inelegant implementation like this;

I thought I could use a FEEL expression on the input or the input variable to perform conversion from the Json string to a date value like this;
Expression

Questions:
What syntax should I use where to realise the most elegant solution?
If an input column is marked as a date type, what is the syntax for expressing data constants or date constants in a range?
If the input type is a date, can I use an expression or similar to converts from the Json text attribute to a typed value?

Ive tried a few variations, but the best I can get to is errors such as cant compare a Date to a Date Time or cant compare a string value to a date value…

regards

Rob

Hi @Webcyberrob :wave:

you were close. In FEEL, a date must be written within the date function: date("2020-01-01")

Since the FEEL date is not natively supported, you should set the input type to feel-date (or something else).

If you just need the year of the date then you can write it a bit shorter. See:

Does this help you?

Best regards,
Philipp

1 Like