Uploaded image for project: 'JBoss BPMS Platform'
  1. JBoss BPMS Platform
  2. RHBPMS-4582

[GSS] (6.4.z) Alpha node not shared with static function evaluation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 6.4.1
    • 6.4.0
    • BRE
    • None
    • CR2

      The following code when placed in Misc2Test exhibit the problem

          public static class TestStaticUtils {
              public static int return1() { 
                  return 1;
              }
          }
          
          @Test
          public void testCheck2() {
              String drl = "package c;\n" + // <<- keep this package name
                      "\n" + 
                      "import " + TestObject.class.getCanonicalName() + "\n" +
                      "\n" + 
                      "rule fileBrule1 when\n" + 
                      "  TestObject(value == 1)\n" + 
                      "then\n" + 
                      "end"
                      ;
              
              String drl2 = "package iTransiberian;\n" + // <<- keep this package name
                      "\n" + 
                      "import " + TestObject.class.getCanonicalName() + "\n" +
                      "import " + TestStaticUtils.class.getCanonicalName() + "\n" +
                      "\n" + 
                      "rule fileArule1 when\n" + 
                      "  $t : String()\n" + 
                      "  TestObject(value == TestStaticUtils.return1() )\n" + 
                      "then\n" + 
                      "end\n"+ 
                      "rule fileArule2 when\n" + // <<- keep this rule
                      "  $t : String()\n" + 
                      "  TestObject(value == 0 )\n" + 
                      "then\n" + 
                      "end\n" + 
                      ""
                      ;
      
              KieSession kieSession = new KieHelper()
                          .addContent(drl2, ResourceType.DRL)
                          .addContent(drl, ResourceType.DRL)
                          .build().newKieSession();
              
              ReteDumper.dumpRete(kieSession);
              System.out.println(drl);
              System.out.println(drl2);
              kieSession.addEventListener(new DebugAgendaEventListener());
      
              kieSession.insert("test");
              kieSession.insert(new TestObject(1));
      
              assertEquals(2, kieSession.fireAllRules() );
          }
      

      Conducting further analysis...

              etirelli@redhat.com Edson Tirelli
              rhn-support-ajuricic Amana Juricic
              Tibor Zimányi Tibor Zimányi
              Tibor Zimányi Tibor Zimányi
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: