tiagobento opened a new issue, #977:
URL: https://github.com/apache/incubator-kie-issues/issues/977

   This issue has come to my attention first reported by @timwuthenow, while 
trying to add a list of `days and time duration` using the `sum` function.
   
   To my surprise, it indeed didn't work, and looking as the specification 
(thanks @baldimir and @gitgabrio) there's indeed no mention to types other than 
`number` being used with the `sum` function.
   
   
![image](https://github.com/apache/incubator-kie-issues/assets/1584568/63bcf5c2-82c3-4378-b417-86181a59c90a)
   
   It sounds odd that the `sum` function wouldn't be compatible with types that 
do work with the `+` operator.
   
   Also, there was no way to work around this limitation, making it impossible 
to add a dynamic list of `date and time duration`.
   
   My opinion is that, although not part of the specification, the `sum` 
function should work with the non-strictly-compatible mode of the DMN engine. 
(Thanks @baldimir for mentioning that this exists!). This of course would apply 
to other accumulator functions present on the FEEL specification: 
   
   - `count` --> This one probably works already.
   - `min`
   - `max`
   - `sum`
   - `mean`
   - `product` --> This one would work for the same types that support the `*` 
operator, of course, which I don't think the duration types do.
   - `median`
   - `stddev`
   - `mode` --> Probably works too? Not sure.
   
   
   ---
   
   
   Also, as curiosity, does anyone know why wouldn't FEEL implement a generic 
`reduce` function? I mean, having those accumulator functions is great, of 
course, but not exposing the raw accumulator technique might hurt users who 
need a little bit more control, no?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to