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

Compound BigDecimal operator is translated to assignOperator in MVEL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.49.0.Final
    • None
    • core engine
    • None

    Description

      @Test
      @Ignore("without B it doesn't work on MVEL")
      public void testCompoundOperator() throws Exception {
      
       // DROOLS-5894
       String drl =
       "import " + Person.class.getCanonicalName() + "\n" +
       "dialect \"mvel\"\n" +
       "rule R\n" +
       "when\n" +
       " $p : Person( age >= 26 )\n" +
       "then\n" +
       " $p.money += 50000;\n" +
       "end";
      
       KieSession ksession = getKieSession(drl);
      
       Person john = new Person("John", 30);
       john.setMoney( new BigDecimal( 70000 ) );
      
       ksession.insert(john);
       assertEquals(1, ksession.fireAllRules());
       assertEquals(new BigDecimal( 120000 ), john.getMoney());
      }

      Attachments

        Issue Links

          Activity

            People

              rhn-support-tkobayas Toshiya Kobayashi
              lmolteni@redhat.com Luca Molteni
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: