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

Compilation fails on generated model

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • 7.38.0.Final, 7.39.0.Final, 7.40.0.Final, 7.41.0.Final, 7.42.0.Final
    • executable model
    • None

    Description

      Given the following rule:

      import java.util.Map;
      import java.util.List;
      
      global java.util.Set controlSet;
      global org.example.drools.service.DummyService dummyService;
      
      rule "will execute per each Measurement having ID color"
      no-loop
      when
       $m: Measurement( id == "color", $colorVal : val )
       String() from dummyService.dummy($m.getId(), $m.getVal())
      then
       controlSet.add($colorVal);
      end

       

      Compiling the generated model throws:

      [...]/drools-model-compiler/main/java/defaultpkg/Rules6348cbea36f646fc98d4712bf48686c6RuleMethods0.java:[25,111] no suitable method found for from(org.drools.model.Global<org.example.drools.service.DummyService>,org.drools.model.Variable<org.example.drools.model.Measurement>,org.drools.model.Variable<org.example.drools.model.Measurement>,defaultpkg.P6C.LambdaExtractor6C9C4CCEE9EF61AD2FF71F545BAC12C2)
      [ERROR] method org.drools.model.DSL.<T>from(T) is not applicable
      [ERROR] (cannot infer type-variable(s) T
      [ERROR] (actual and formal argument lists differ in length))
      [ERROR] method org.drools.model.DSL.<T>from(org.drools.model.Variable<T>) is not applicable
      [ERROR] (cannot infer type-variable(s) T
      [ERROR] (actual and formal argument lists differ in length))
      [ERROR] method org.drools.model.DSL.<T>from(org.drools.model.functions.Function0<T>) is not applicable
      [ERROR] (cannot infer type-variable(s) T
      [ERROR] (actual and formal argument lists differ in length))
      [ERROR] method org.drools.model.DSL.<T>from(org.drools.model.Variable<T>,org.drools.model.functions.Function1<T,?>) is not applicable
      [ERROR] (cannot infer type-variable(s) T
      [ERROR] (actual and formal argument lists differ in length))
      [ERROR] method org.drools.model.DSL.<A,B>from(org.drools.model.Variable<A>,org.drools.model.Variable<B>,org.drools.model.functions.Function2<A,B,?>) is not applicable
      [ERROR] (cannot infer type-variable(s) A,B
      [ERROR] (actual and formal argument lists differ in length))
      [ERROR] method org.drools.model.DSL.<A,B,C>from(org.drools.model.Variable<A>,org.drools.model.Variable<B>,org.drools.model.Variable<C>,org.drools.model.functions.Function3<A,B,C,?>) is not applicable
      [ERROR] (cannot infer type-variable(s) A,B,C
      [ERROR] (argument mismatch; defaultpkg.P6C.LambdaExtractor6C9C4CCEE9EF61AD2FF71F545BAC12C2 cannot be converted to org.drools.model.functions.Function3<A,B,C,?>))
      [ERROR] method org.drools.model.DSL.<A,B,C,D>from(org.drools.model.Variable<A>,org.drools.model.Variable<B>,org.drools.model.Variable<C>,org.drools.model.Variable<D>,org.drools.model.functions.Function4<A,B,C,D,?>) is not applicable
      [ERROR] (cannot infer type-variable(s) A,B,C,D
      [ERROR] (actual and formal argument lists differ in length))

       

      This error occurs as well with drools version 7.43.0-SNAPSHOT

       

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: