Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-2650

date comparison using LocatDateTime

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • None
    • 7.7.0.Final
    • core engine
    • None
    • 2018 Week 36-38
    • NEW
    • NEW

      While upgrading Drools from version 6.5 to 7.7.0, there is a compile issue in rules that use Date Compare.

      e.g. the following rule works fine in 6.5, but errors out in 7.7.0:

      when
      $inventory : AllocatedInventory(expireDateTime != null && (expireDateTime > Custom.todayPlus(0) && <= Custom.todayPlus(2)) )

      then
      modify(...)

      { ... }

      retract($inventory);
      end
      =======================
      Custom function returns Java LocalDateTime (java.util.Date and JodaTime use is deprecated)
      The reason it breaks is due to check in function https://github.com/kiegroup/drools/blob/master/drools-compiler/src/main/java/org/drools/compiler/rule/builder/MVELConstraintBuilder.java#L229

      Previous version does not have that check. Now, it seems the compiler check compares date value to java.util.Date

      Request a feature to allow LocalDateTime date compare

              mfusco@redhat.com Mario Fusco
              snsubhedar Sachin Subhedar (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: