]
Mario Fusco moved RHDM-1554 to DROOLS-5928:
-------------------------------------------
Component/s: executable model
(was: BRE)
Docs QE Status: NEW
Key: DROOLS-5928 (was: RHDM-1554)
QE Status: NEW
Affects Version/s: (was: 7.1.0.GA)
(was: 7.9.0.GA)
Workflow: GIT Pull Request workflow (was: CDW with docs v1)
Environment: (was: This issue occurs on all releases from RHDM 7.1.0 to
7.9.0.)
Project: Drools (was: Red Hat Decision Manager)
The use of AND in source pattern of accumulate causes compilation
error in executable model.
--------------------------------------------------------------------------------------------
Key: DROOLS-5928
URL:
https://issues.redhat.com/browse/DROOLS-5928
Project: Drools
Issue Type: Bug
Components: executable model
Reporter: Mario Fusco
Assignee: Mario Fusco
Priority: Major
Labels: support
Attachments: reproducer_model_compiler_7a.zip
Building a rule written in MVEL dialect like (*1) using {{AND}} in source pattern of
{{accumulate}} like (\*1-1) in executable rule model, a compilation error (\*2) occurs.
This issue does not occur when we build the rule with executable model disabled.
(\*1)
{noformat}
package com.example.reproducer
import java.math.BigDecimal
dialect "mvel"
rule "rule7a2"
when
$total : BigDecimal() from accumulate( $car : Car( discontinued == true ) and
Order( item == $car, $price : price ), // ..... (*1-1)
init( BigDecimal total = BigDecimal.ZERO;
),
action( total += $price; ),
reverse( total -= $price; ),
result( total ) )
then
System.out.println("***** Action of rule7a2 -- $total = " + $total);
end
{noformat}
(\*2)
{noformat}
[ERROR]
/work2/testdir/reproducer_model_compiler_7a/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/Rulese69ee9f6a2a84acaa675792cae099156RuleMethods0.java:[28,63]
method accumulate in class org.drools.model.DSL cannot be applied to given types;
required:
org.drools.model.view.ViewItem<?>,org.drools.model.functions.accumulate.AccumulateFunction,org.drools.model.functions.accumulate.AccumulateFunction[]
found: org.drools.model.view.ViewItem
reason: cannot infer type-variable(s) T
(actual and formal argument lists differ in length)
{noformat}