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

Cannot use method chaining as source for facts

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • 7.42.0.Final
    • executable model
    • None
    • 2020 Week 34-36 (from Aug 17), 2020 Week 37-39 (from Sep 7)
    • Hide

      Please compile the rule above.

      Show
      Please compile the rule above.
    • NEW
    • NEW

    Description

      Given the sample rule below:

      import java.util.*;
      
      global java.util.Set controlSet;
      
      rule "will execute per each Measurement having ID color"
      no-loop
      when
       Measurement( id == "color", $colorVal : val )
       String() from Optional.of($colorVal).orElse("blah")
      then
       controlSet.add($colorVal);
      end

       

      Compiling the resulting model fails with:

      .../target/generated-sources/drools-model-compiler/main/java/rules/Rules79f20b1c9ba841128eaf4b2dbb336819RuleMethods0.java:[24,129] cannot find symbol
      [ERROR] symbol: variable $colorVal
      [ERROR] location: class rules.Rules79f20b1c9ba841128eaf4b2dbb336819RuleMethods0

      Can be reproduced with 7.43.0-SNAPSHOT

       

      Attachments

        Activity

          People

            lmolteni@redhat.com Luca Molteni
            cchiru Ciprian Chiru (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: