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

org.apache.maven.plugins:maven-compiler-plugin fails on the generated model

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 7.40.0.Final
    • Fix Version/s: None
    • Component/s: executable model
    • Labels:
      None
    • Sprint:
      2020 Week 31-33 (from Jul 27)
    • Steps to Reproduce:
      Hide

      Create a rule calling in the LHS a function with more than 2 parameters and pass variables to that function, not constants.

      In the bugs description there is an example.

      Show
      Create a rule calling in the LHS a function with more than 2 parameters and pass variables to that function, not constants. In the bugs description there is an example.
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      Given a rule as such (modified from the standard example):

       

      global org.example.drools.service.DummyService dummyService;
      
      rule "will execute per each Measurement having ID color"
      no-loop
      when
       Measurement( id == "color", $colorVal : val )
       $var1: String() from dummyService.dummy("a");
       $var2: String() from dummyService.dummy("b");
       $var3: String() from dummyService.dummy("c");
       String() from dummyService.dummy($var1, $var2, $var3)
      then
       controlSet.add($colorVal);
      end

      The org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile fails with:

      no suitable method found for from(org.drools.model.Global<org.example.drools.service.DummyService>,org.drools.model.Variable<java.lang.String>,org.drools.model.Variable<java.lang.String>,org.drools.model.Variable<java.lang.String>,rules.PFD.LambdaExtractorFD1FA74D5FA8CFA329D97E34A42287FA)
      [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] (actual and formal argument lists differ in length))

       

      So the DSL.from() cannot accept more than 2 variables.

       

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  lucamolteni Luca Molteni
                  Reporter:
                  cchiru Ciprian Chiru
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: