Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-1092

Invalid Java code generated from 'accumulate' function with nested classes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.0.0.GA
    • Fix Version/s: 4.0.1
    • Component/s: None
    • Labels:
      None

      Description

      Steps to reproduce:

      • Create a sample new project with the Eclipse plugin
      • Add following rule to the .drl file
      • Execute DroolsTest

      rule "AccumulateTest"
      no-loop true
      when
      $d: Double()
      from accumulate ( m : Message( $value: status ),
      init( double total = 0; ),
      action( total += $status ),
      result( total )
      )
      then
      System.out.println( "ok" );

      end

      Exception is:
      org.drools.rule.InvalidRulePackage: Rule Compilation error : [Rule name=AccumulateTest, agendaGroup=MAIN, salience=0, no-loop=true]
      com/sample/Rule_AccumulateTest_0.java (27:834) : The nested type com.sample.DroolsTest$Message cannot be referenced using its binary name
      com/sample/Rule_AccumulateTest_0.java (27:869) : The nested type com.sample.DroolsTest$Message cannot be referenced using its binary name
      com/sample/Rule_AccumulateTest_0.java (29:1027) : Syntax error, insert ";" to complete Statement
      com/sample/Rule_AccumulateTest_0.java (29:1027) : $status cannot be resolved
      com/sample/Rule_AccumulateTest_0.java (39:1483) : The nested type com.sample.DroolsTest$Message cannot be referenced using its binary name
      com/sample/Rule_AccumulateTest_0.java (39:1518) : The nested type com.sample.DroolsTest$Message cannot be referenced using its binary name

      at org.drools.rule.Package.checkValidity(Package.java:408)
      at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:288)
      at com.sample.DroolsTest.readRule(DroolsTest.java:64)
      at com.sample.DroolsTest.main(DroolsTest.java:21)

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                tirelli Edson Tirelli
                Reporter:
                agattik Alexandre Gattiker
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: