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

Window operators - Type safety

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 6.2.0.Final
    • core engine
    • None
    • Hide

      1) Create a rule using a window operator, but using a invalid operator after the "over" keyword. Example:

      $b1: (SensorReading() over time:window(10s))

      2) Load the rule and insert objects into the Working Memory. No exceptions are thrown, but unexpected behaviour may arise.

      Show
      1) Create a rule using a window operator, but using a invalid operator after the "over" keyword. Example: $b1: (SensorReading() over time:window(10s)) 2) Load the rule and insert objects into the Working Memory. No exceptions are thrown, but unexpected behaviour may arise.

      It seems the rule compiler is not correctly checking type safety when using window operators to define rule conditions.

      I defined a rule using the following code (note that I incorrectly used "time:window" to define the window, instead of "window:time"):

      declare SensorReading
      @role(event)
      @timestamp(timestamp)
      end

      rule "boilers"
      when
      $b1: (SensorReading(sensorId == 1L && status == SensorStatus.ON) over time:window(10s))
      then
      ....
      end

      The rule has been compiled and executed, but not following the correct window semantics. The forum link contains a full description of the (unexpected) behaviour I found when defining rule like this.

            Unassigned Unassigned
            wilson.higashino Wilson Akio Higashino (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: