]
Jonas Beyer commented on DROOLS-5710:
-------------------------------------
Thanks! :)
[DMN XML] Signavio Profile - DayDiffFunction: Should work with Date
and DateTime values
---------------------------------------------------------------------------------------
Key: DROOLS-5710
URL:
https://issues.redhat.com/browse/DROOLS-5710
Project: Drools
Issue Type: Bug
Components: dmn engine
Reporter: Jonas Beyer
Assignee: Matteo Mortari
Priority: Minor
If the DayDiff() function is called with a parameter of data type Date, an error is
thrown during runtime.
Example:
{quote}dayDiff(myDate, today())
{quote}
h3. Acceptance Criteria:
* DayDiff function can be called with datatypes Date and Datetime in any combination
** Date, Date
** Date, Datetime
** Datetime, Date
** Datetime, Datetime
h3. Details:
The {{DayDiffFunction}} is implemented using {{Duration#between}} . This implementation
will try to calculate the duration between the given {{Temporal}} s based on their
nanoseconds or seconds, which can't be extracted from values of type Date that
don't have a time component.
Suggestion: Manually convert the parameters to {{Instant}} s, using the start of the day
as time component for Date values.