]
Luca Molteni updated DROOLS-5542:
---------------------------------
Sprint: 2020 Week 31-33 (from Jul 27)
org.apache.maven.plugins:maven-compiler-plugin fails on the generated
model
---------------------------------------------------------------------------
Key: DROOLS-5542
URL:
https://issues.redhat.com/browse/DROOLS-5542
Project: Drools
Issue Type: Bug
Components: executable model
Affects Versions: 7.40.0.Final
Reporter: Ciprian Chiru
Assignee: Luca Molteni
Priority: Major
Given a rule as such (modified from the standard example):
{code:java}
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{code}
The _org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile_ fails with:
{code:java}
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)){code}
So the DSL.from() cannot accept more than 2 variables.