Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3373

Accumulate function doesn't work at all in 5.3.0 Final

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Hide

      1. I'm setting the stream mode to work with events (kbaseConfig.setOption( EventProcessingOption.STREAM )
      2. I have a simple DRL file

      declare StateEvent
      @role( event )
      end

      rule "Test"

      when
      Number($total : doubleValue) from accumulate(
      StateEvent(itemName=="Temperatura", $val : newState) over window:length( 5 ) from entry-point "EventStream",
      average ( ((DecimalType)$val).toBigDecimal().doubleValue() ) )

      then
      System.out.println("" + $total);
      end

      3. I insert a fact into working memory (entry point "EventStream")

      WorkingMemoryEntryPoint entry = ksession.getWorkingMemoryEntryPoint("EventStream");
      entry.insert((RuleEvent) new StateEvent(item, state));

      4. Fire rules

      5. Repeat steps 3 and 4 to put accumulate and average functions to work

      RESULTS WITH 5.2.0 Final

      Works nicely, i can see the average updated with every fact inserted.

      RESULTS WITH 5.3.0 Final

      It returns the same result and average (neither sum or the simplest case count(1)) doesn't work.

      Show
      1. I'm setting the stream mode to work with events (kbaseConfig.setOption( EventProcessingOption.STREAM ) 2. I have a simple DRL file declare StateEvent @role( event ) end rule "Test" when Number($total : doubleValue) from accumulate( StateEvent(itemName=="Temperatura", $val : newState) over window:length( 5 ) from entry-point "EventStream", average ( ((DecimalType)$val).toBigDecimal().doubleValue() ) ) then System.out.println("" + $total); end 3. I insert a fact into working memory (entry point "EventStream") WorkingMemoryEntryPoint entry = ksession.getWorkingMemoryEntryPoint("EventStream"); entry.insert((RuleEvent) new StateEvent(item, state)); 4. Fire rules 5. Repeat steps 3 and 4 to put accumulate and average functions to work RESULTS WITH 5.2.0 Final Works nicely, i can see the average updated with every fact inserted. RESULTS WITH 5.3.0 Final It returns the same result and average (neither sum or the simplest case count(1)) doesn't work.

    Description

      Accumulate doesn't work in 5.3.0 Final, even the most basic cases. The same rules and code work nicely with 5.2.0 Final.

      Attachments

        Activity

          People

            etirelli@redhat.com Edson Tirelli
            juankera Juanker Atina (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Archived:

              PagerDuty