[
https://issues.redhat.com/browse/DROOLS-5710?page=com.atlassian.jira.plug...
]
Matteo Mortari commented on DROOLS-5710:
----------------------------------------
Hi [~jonas.beyer] if you are going to propose an extension of this Signavio function for a
default behaviour as listed in the acceptance criteria, is very fine with me, I just
wanted to add a potential additional solution would be (without modification) just
having:
{code:java}
dayDiff(myDate, now())
{code}
[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.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)