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

Drools model compiler fails when assigning salience from a static constant

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 7.31.0.Final, 7.32.0.Final, 7.33.0.Final, 7.34.0.Final, 7.35.0.Final, 7.36.0.Final, 7.37.0.Final, 7.38.0.Final, 7.39.0.Final, 7.40.0.Final
    • None
    • None
    • 2020 Week 31-33 (from Jul 27)
    • NEW
    • NEW

      Given the example rule:

      global java.util.Set controlSet;
      
      
      rule "will execute per each Measurement having ID color"
      salience Salience.NORMAL
      no-loop
      when
       Measurement( id == "color", $colorVal : val )
      then
       controlSet.add($colorVal);
      end

      when compiling the rules, the org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile  throws:

      Compilation failure
      [ERROR] .../target/generated-sources/drools-model-compiler/main/java/rules/Rules1b5c9512461f45df875fa525fff06227RuleMethods0.java:[28,109] no suitable method found for supply(int)
      [ERROR] method org.drools.model.DSL.<A,R>supply(org.drools.model.Variable<A>,org.drools.model.functions.Function1<A,R>) is not applicable
      [ERROR] (cannot infer type-variable(s) A,R
      [ERROR] (actual and formal argument lists differ in length))
      [ERROR] method org.drools.model.DSL.<A,B,R>supply(org.drools.model.Variable<A>,org.drools.model.Variable<B>,org.drools.model.functions.Function2<A,B,R>) is not applicable
      [ERROR] (cannot infer type-variable(s) A,B,R
      [ERROR] (actual and formal argument lists differ in length))

       

      The same rule works fine when the rule is not pre-compiled.

              mfusco@redhat.com Mario Fusco
              cchiru Ciprian Chiru (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: