Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-1423

An accumulate with more than one binding is wrongly generated in the executable model

    Details

    • Type: Bug
    • Status: Verified (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 7.7.0.GA, 7.8.0.GA
    • Fix Version/s: 7.8.1.GA
    • Component/s: BRE
    • Labels:
    • Target Release:
    • Fix Build:
      CR1
    • Sprint:
      2020 Week 31-33 (from Jul 27)
    • QE Test Coverage:
      +

      Description

      Reproducer

       @Test
      public void testAccumulateWithManyBindings() {
          String str =
                  "import " + Person.class.getCanonicalName() + ";\n" +
                  "rule R when\n" +
                  "  accumulate (\n" +
                  "       Person($age : age, $name : name), $max : max( $name.length() ) " +
                  "         )" +
                  "then\n" +
                  "  insert($max);\n" +
                  "end";
      
          KieSession ksession = getKieSession( str );
      
          ksession.insert( new Person( "Mario", 40 ) );
          ksession.insert( new Person( "Mark", 40 ) );
          ksession.insert( new Person( "Luca", 40 ) );
      
          ksession.fireAllRules();
      
          List<Number> results = getObjectsIntoList(ksession, Number.class);
          assertEquals(1, results.size());
          assertEquals(5, results.get(0).intValue());
      }

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mfusco Mario Fusco
                  Reporter:
                  mputz Martin Weiler
                  Tester:
                  Daniel Rosa
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: