Date Based Rules

Hello,

We are trying to implement date based rules on Decision Table in Flowable DMN,
for e.g current date- start date > 2 or any two date comparison,

Any suggestions or links I can use to implement these rules?

Thanks in advance,
Yougal BISHT

If you want an input (date) variable to be compared with a static date defined in a rule you can do something like this;

Or you could use custom (JUEL) expressions and make use of some build in helpers;

For instance; with date:toDate() you create a Date instance which you can use in the the expression.
Also; date:now() creates a current date Date instance.

Hope this helps.

Regards,

Yvo

Hi @yvo,

Lets says input variable startDate=‘2020-01-01’ and I wanted check that difference between start date and current date > 30. How would the expression gonna looks like?

Like this:

${date:now() - startDate >30}

${date:now() - date:toDate(startDate) >30}

Can we get any documentation for custom (JUEL) expressions which can be use in Rule tables?

Blockquote
Can we get any documentation for custom (JUEL) expressions which can be use in Rule tables?

The default / included function delegates can be found here; repo

This can be expanded though. Have a look in the documentation to see how.

As for the date expression; you could do something like this; comparing two dates;

${date:addDate(startDate,0,0,30) < date:now()}  //add 30 days to startDate and do a comparison between dates

Regards,

Yvo

1 Like