[jboss-jira] [JBoss JIRA] (DROOLS-5548) Model compiler cannot generate declaration from a function call
Luca Molteni (Jira)
issues at jboss.org
Fri Jul 31 09:51:01 EDT 2020
[ https://issues.redhat.com/browse/DROOLS-5548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Luca Molteni updated DROOLS-5548:
---------------------------------
Summary: Model compiler cannot generate declaration from a function call (was: Model compiler cannot generate code for method calls using variable accessors)
> Model compiler cannot generate declaration from a function call
> ---------------------------------------------------------------
>
> Key: DROOLS-5548
> URL: https://issues.redhat.com/browse/DROOLS-5548
> Project: Drools
> Issue Type: Bug
> Components: executable model
> Affects Versions: 7.31.0.Final, 7.32.0.Final, 7.33.0.Final, 7.34.0.Final, 7.35.0.Final, 7.36.0.Final, 7.37.0.Final, 7.38.0.Final, 7.39.0.Final, 7.40.0.Final
> Reporter: Ciprian Chiru
> Assignee: Luca Molteni
> Priority: Major
>
> Given the example rule below (based on the drools example rule)
>
> {code:java}
> global java.util.Set controlSet;
> declare A
> x: String
> end
> declare B
> a: A
> end
> function String dummyFunction(B b) {
> return "test";
> }
> rule "will execute per each Measurement having ID color"
> no-loop
> when
> Measurement( id == "color", $colorVal : val )
> $b: B()
> $val: String() from dummyFunction($b.a)
> then
> controlSet.add($colorVal);
> end{code}
>
>
> When compiling the rule with _kie-maven-plugin_ it fails with :
> {noformat}
> ...target/generated-sources/drools-model-compiler/main/java/rules/Rules5937a2896da74f01bfa36d294bcf0858RuleMethods0.java:[32,107] cannot find symbol
> [ERROR] symbol: variable $b
> [ERROR] location: class rules.Rules5937a2896da74f01bfa36d294bcf0858RuleMethods0{noformat}
> It transpiles and compiles fine with:
> {code:java}
> $val: String() from dummyFunction($b){code}
>
> This can probably be reproduced on all version.
> It works when the rules are not pre-compiled.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list