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

Change Rule Containing Window Time

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 6.2.0.Final
    • Fix Version/s: 6.3.0.Final
    • Component/s: core engine
    • Labels:
      None
    • Environment:

      CentOS 6.4

    • Steps to Reproduce:
      Hide

      1. Setting Project (described in detail below)
      2. Repeatedly send Rest call using SoapUI
      3. Change window time and hot deploy in 1m(window time)
      4. Check Count. But.. return wrong result count. (rower or higher)

      ==================================================
      Drools Workbench + Kie Server (6.2)

      Knowledge Base Setting

      • Processing Mode : Stream Mode
      • Knowledge Session
      • State : Stateful, Clock : Realtime

      sample rest
      <batch-execution lookup="testSession">
      <insert out-identifier="name" return-object="true">
      <AnEvent>
      <source>1</source>
      <word>in</word>
      </AnEvent>
      </insert>
      <fire-all-rules/>
      </batch-execution>

      DRL file
      declare AnEvent
      @expires(5m)
      @role( event )
      source : int
      word : String
      end

      rule "Rule-s1-1"
      when
      Number( $result : intValue ) from accumulate(AnEvent( $src: source, $wrd: word) over window:time(1m) from entry-point EP1, count( $src) )
      then
      System.out.println(" !!@-------> Result-s1-1 (CNT): " + $result);
      end

      rule "Rule-s1-2"
      when
      Number( $result3 : intValue) from accumulate(AnEvent( $src: source, $wrd: word) over window:time(10s) from entry-point EP1, count( $src ))
      then
      System.out.println(" !!@-------> Result-s1-2 (CNT): " + $result3);
      end

      Show
      1. Setting Project (described in detail below) 2. Repeatedly send Rest call using SoapUI 3. Change window time and hot deploy in 1m(window time) 4. Check Count. But.. return wrong result count. (rower or higher) ================================================== Drools Workbench + Kie Server (6.2) Knowledge Base Setting Processing Mode : Stream Mode Knowledge Session State : Stateful, Clock : Realtime sample rest <batch-execution lookup="testSession"> <insert out-identifier="name" return-object="true"> <AnEvent> <source>1</source> <word>in</word> </AnEvent> </insert> <fire-all-rules/> </batch-execution> DRL file declare AnEvent @expires(5m) @role( event ) source : int word : String end rule "Rule-s1-1" when Number( $result : intValue ) from accumulate(AnEvent( $src: source, $wrd: word) over window:time(1m) from entry-point EP1, count( $src) ) then System.out.println(" !!@-------> Result-s1-1 (CNT): " + $result); end rule "Rule-s1-2" when Number( $result3 : intValue) from accumulate(AnEvent( $src: source, $wrd: word) over window:time(10s) from entry-point EP1, count( $src )) then System.out.println(" !!@-------> Result-s1-2 (CNT): " + $result3); end
    • Affects:
      Compatibility/Configuration, User Experience
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      I tested rule contain sliding window.

      But when i deployed the rule to change window time,

      I failed hot deploy during window time, and some data lost.

      My drools fusion is 6.2.0 version

      I attached trace result.

      11:32:16,089 ERROR [org.kie.server.services.rest.KieServerRestImpl] (http--0.0.0.0-8080-16) Error calling container 'test': java.lang.RuntimeException: Unexpected exception executing action org.drools.core.impl.StatefulKnowledgeSessionImpl$WorkingMemoryReteExpireAction@133c5d96
      at org.drools.core.impl.StatefulKnowledgeSessionImpl.executeQueuedActions(StatefulKnowledgeSessionImpl.java:1567) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.drools.core.common.NamedEntryPoint.insert(NamedEntryPoint.java:358) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.drools.core.common.NamedEntryPoint.insert(NamedEntryPoint.java:289) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.drools.core.common.NamedEntryPoint.insert(NamedEntryPoint.java:142) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.drools.core.command.runtime.rule.InsertObjectCommand.execute(InsertObjectCommand.java:88) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.drools.core.command.runtime.rule.InsertObjectCommand.execute(InsertObjectCommand.java:39) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.drools.core.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:155) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.drools.core.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:76) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.drools.core.impl.StatefulKnowledgeSessionImpl.execute(StatefulKnowledgeSessionImpl.java:723) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.drools.core.impl.StatefulKnowledgeSessionImpl.execute(StatefulKnowledgeSessionImpl.java:697) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.kie.server.services.impl.KieServerImpl.callContainer(KieServerImpl.java:210) [kie-server-services-6.2.0.Final.jar:6.2.0.Final]
      at org.kie.server.services.rest.KieServerRestImpl.execute(KieServerRestImpl.java:85) [kie-server-services-6.2.0.Final.jar:6.2.0.Final]
      at sun.reflect.GeneratedMethodAccessor105.invoke(Unknown Source) [:1.7.0_75]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_75]
      at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_75]
      at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.2.Final.jar:]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489) [jbossweb-7.0.13.Final.jar:]
      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_75]
      Caused by: java.lang.ClassCastException: org.drools.core.reteoo.PathMemory cannot be cast to org.drools.core.reteoo.WindowNode$WindowMemory
      at org.drools.core.reteoo.WindowNode.retractRightTuple(WindowNode.java:199) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.drools.core.reteoo.ObjectTypeNode.doRetractObject(ObjectTypeNode.java:345) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.drools.core.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:337) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.drools.core.impl.StatefulKnowledgeSessionImpl$WorkingMemoryReteExpireAction.execute(StatefulKnowledgeSessionImpl.java:1857) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      at org.drools.core.impl.StatefulKnowledgeSessionImpl.executeQueuedActions(StatefulKnowledgeSessionImpl.java:1565) [drools-core-6.2.0.Final.jar:6.2.0.Final]
      ... 39 more

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mfusco Mario Fusco
                  Reporter:
                  ljwandy 재우 이
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: