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

Date Between Dates Not Triggering for Drools Executable Model

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 8.44.0.Final
    • executable model
    • None
    • Hide

      In the attached tar ball, the maven project has a unit test, DateRulesTest, with several failing test cases because of this issue preventing some simple rules from firing.  It also shows that the exact same rules when executed using the DRL files directly do fire as expected.  The rules being tested can be found in DateRules.drl, and include multiple very simple rules using the same date field including: sanity checks and various iterations of assertions using the same fields and constants.

      Show
      In the attached tar ball, the maven project has a unit test, DateRulesTest, with several failing test cases because of this issue preventing some simple rules from firing.  It also shows that the exact same rules when executed using the DRL files directly do fire as expected.  The rules being tested can be found in DateRules.drl, and include multiple very simple rules using the same date field including: sanity checks and various iterations of assertions using the same fields and constants.
    • Workaround Exists
    • Hide

      By using drools-engine-classic rather than drools-engine, the issue does not occur.  In short: not using the executable model version of drools but using the DRL files directly (not the precompiled rules) the issue does not occur.

       

      Also by converting expressions from "DateHolder( date < $runDate && date >
      $monthBeforeRunDate)" to "DateHolder( date < $runDate && >
      $monthBeforeRunDate)" can fix the issue.

      Show
      By using drools-engine-classic rather than drools-engine, the issue does not occur.  In short: not using the executable model version of drools but using the DRL files directly (not the precompiled rules) the issue does not occur.   Also by converting expressions from "DateHolder( date < $runDate && date > $monthBeforeRunDate)" to "DateHolder( date < $runDate && > $monthBeforeRunDate)" can fix the issue.
    • NEW
    • NEW
    • ---
    • ---

      When using the Drools executable model (pre-compiled) to execute an expression of a Date being between two other Dates like "DateHolder( date < $runDate && date >
      $monthBeforeRunDate)", the related rule does not fire when the date value is actually between the two Date constants. 

      Switching the order of the greater or less than statements does not fix the issue.  Using inclusive between (<= and >=) does not solve the issue for date field values (non-inclusively) between the dates.

      However if the expression is changed to "DateHolder( date < $runDate && > $monthBeforeRunDate)" it does fire as expected.

      I have not checked to see if this issue effects other data types like long or int. 

      Also when using the DRL files directly (by adding the DRL files directly to KnowledgeBuilder) in the drools engine, this issue does not occur.

              rhn-support-tkobayas Toshiya Kobayashi
              herringtond@aetna.com David Herrington (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: