holunda-io / camunda-bpm-taskpool

Library for pooling user tasks and process related business objects.
https://www.holunda.io/camunda-bpm-taskpool/
Apache License 2.0
68 stars 26 forks source link

Cannot filter on dueDate because Instant is not supported by CompareOperator #748

Closed jangalinski closed 1 year ago

jangalinski commented 1 year ago

Steps to reproduce

In SimpleView, use filterString task.dueDate<NOW (NOW = Instant.now().toString().

this block falls back to string and checks if the dueDate String endswith NOW ...which is always false.

 LESS -> { filter, actual ->
      when (actual) {
        is String -> actual.endsWith(filter.toString())
        is Int -> actual < Integer.parseInt(filter.toString())
        is Date -> actual.toInstant().isBefore(Instant.parse(filter.toString()))
        is BigDecimal -> actual.subtract(BigDecimal(filter.toString())) < BigDecimal.ZERO
        else -> actual.toString().endsWith(filter.toString())
      }

Fix: Add Instance conversion to when