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

Drools throws CCE when using global SessionClock in temporal operator

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.4.0.Beta1
    • 6.3.0.Final
    • core engine
    • None
    • Max OS X 10.11.1, Oracle Hotspot 1.8.0_45

    • Hide

      1) Clone the following Git repo: https://github.com/DuncanDoyle/drools-cce-issue
      2) Run 'mvn clean test'

      Show
      1) Clone the following Git repo: https://github.com/DuncanDoyle/drools-cce-issue 2) Run 'mvn clean test'
    • NEW
    • NEW

      When I insert the PseudoClock as a global in my KieSession, and I use the clock in combination with a temporal operator in a rule, I get the following CCE:

      Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Date
      	at org.drools.core.base.evaluators.BeforeEvaluatorDefinition$BeforeEvaluator.evaluate(BeforeEvaluatorDefinition.java:301)
      	at org.drools.core.base.EvaluatorWrapper.evaluate(EvaluatorWrapper.java:94)
      	... 61 more
      

      The interesting thing is that this line works:

      $s: SimpleEvent(clock.currentTime after[300s] timestamp)
      

      while this one fails:

      $s: SimpleEvent(timestamp before[300s] clock.currentTime)
      

      Reproducer can be found here: https://github.com/DuncanDoyle/drools-cce-issue
      Just run 'mvn clean test'.

              mfusco@redhat.com Mario Fusco
              rhn-gps-ddoyle Duncan Doyle (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: