]
Luca Molteni updated DROOLS-5591:
---------------------------------
Sprint: 2020 Week 34-36 (from Aug 17)
Compilation fails on generated model
------------------------------------
Key: DROOLS-5591
URL:
https://issues.redhat.com/browse/DROOLS-5591
Project: Drools
Issue Type: Bug
Components: executable model
Affects Versions: 7.38.0.Final, 7.39.0.Final, 7.40.0.Final, 7.41.0.Final,
7.42.0.Final
Reporter: Ciprian Chiru
Assignee: Luca Molteni
Priority: Major
Given the following rule:
{code:java}
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{code}
Compiling the generated model throws:
{code:java}
[...]/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)){code}
This error occurs as well with drools version _7.43.0-SNAPSHOT_