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

CEP doesn't evaluate correctly when a bind variable is used as the first temporal parameter in executable model

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.44.0.Final
    • 7.39.0.Final
    • executable model
    • None
    • 2020 Week 28-30 (from Jul 6), 2020 Week 31-33 (from Jul 27), 2020 Week 34-36 (from Aug 17), 2020 Week 37-39 (from Sep 7)
    • 5
    • NEW
    • NEW

      With the below test, standard-drl fires but executable-model doesn't.

          @Test
          public void testAfterOnLongFields2() throws Exception {
              String str =
                      "import " + StockTick.class.getCanonicalName() + ";\n" +
                      "declare StockTick @timestamp(timeFieldAsLong) end\n" +
                      "rule R when\n" +
                      "    $a : StockTick( company == \"DROO\" )\n" +
                      "    $b : StockTick( company == \"ACME\", $a.timeFieldAsLong after[5,8] timeFieldAsLong )\n" +
                      "then\n" +
                      "  System.out.println(\"fired\");\n" +
                      "end\n";
      
              KieSession ksession = getKieSession(getCepKieModuleModel(), str);
              SessionPseudoClock clock = ksession.getSessionClock();
              
              ReteDumper.dumpRete(ksession);
      
              ksession.insert( new StockTick( "ACME" ).setTimeField( 0 ) );
              ksession.insert( new StockTick( "DROO" ).setTimeField( 6 ) );
      
              assertEquals( 1, ksession.fireAllRules() );
          }
      

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: