[
https://issues.redhat.com/browse/DROOLS-5816?page=com.atlassian.jira.plug...
]
Toshiya Kobayashi updated DROOLS-5816:
--------------------------------------
Description:
- When a rule uses mvel dialect and refers to "kcontext" in RHS with
exec-model,
{noformat}
dialect "mvel"
when
Integer()
then
result.add(kcontext.getRule().getName());
end
{noformat}
it cannot resolve "kcontext" hence compilation fails.
{noformat}
[ERROR] Failures:
[ERROR]
MvelDialectTest.testKcontext:921->BaseModelTest.getKieSession:105->BaseModelTest.getKieSession:109->BaseModelTest.getKieContainer:113->BaseModelTest.getKieContainer:120->BaseModelTest.createKieBuilder:131->BaseModelTest.createKieBuilder:158
[Message [id=1, level=ERROR,
path=src/main/java/defaultpkg/PDF/LambdaConsequenceDF24FCC3F13686A61CE2DA9AF55C71CF.java,
line=20, column=20
text=cannot find symbol
symbol: variable kcontext
location: class defaultpkg.PDF.LambdaConsequenceDF24FCC3F13686A61CE2DA9AF55C71CF],
Message [id=2, level=ERROR,
path=src/main/java/defaultpkg/PDF/LambdaConsequenceDF24FCC3F13686A61CE2DA9AF55C71CF.java,
line=0, column=0
text=Java source of
src/main/java/defaultpkg/PDF/LambdaConsequenceDF24FCC3F13686A61CE2DA9AF55C71CF.java in
error:
...
public enum LambdaConsequenceDF24FCC3F13686A61CE2DA9AF55C71CF implements
org.drools.model.functions.Block1<java.util.List>,
org.drools.model.functions.HashedExpression {
...
@Override()
public void execute(java.util.List result) throws java.lang.Exception {
result.add(kcontext.getRule().getName());
}
}
]]
{noformat}
Note: The same issue is found in org.drools.mvel.integrationtests.KnowledgeContextTest
was:
org.drools.mvel.integrationtests.KnowledgeContextTest in test-compiler-integration fails
with some tests when executable-model is enabled. See TODO comment in the test class. Once
fixed (or the test failure is justified), we can remove the TODO comment and let the test
run with executable-model.
Currently, executable-model is disabled:
{code:java}
// TODO: ....
return TestParametersUtil.getKieBaseCloudConfigurations(false);
{code}
If the test failure contains multiple bugs, we may split this JIRA into multiple JIRAs.
executable-model doesn't resolve kcontext with mvel dialect
-----------------------------------------------------------
Key: DROOLS-5816
URL:
https://issues.redhat.com/browse/DROOLS-5816
Project: Drools
Issue Type: Bug
Components: executable model
Affects Versions: 7.46.0.Final
Reporter: Toshiya Kobayashi
Assignee: Toshiya Kobayashi
Priority: Major
- When a rule uses mvel dialect and refers to "kcontext" in RHS with
exec-model,
{noformat}
dialect "mvel"
when
Integer()
then
result.add(kcontext.getRule().getName());
end
{noformat}
it cannot resolve "kcontext" hence compilation fails.
{noformat}
[ERROR] Failures:
[ERROR]
MvelDialectTest.testKcontext:921->BaseModelTest.getKieSession:105->BaseModelTest.getKieSession:109->BaseModelTest.getKieContainer:113->BaseModelTest.getKieContainer:120->BaseModelTest.createKieBuilder:131->BaseModelTest.createKieBuilder:158
[Message [id=1, level=ERROR,
path=src/main/java/defaultpkg/PDF/LambdaConsequenceDF24FCC3F13686A61CE2DA9AF55C71CF.java,
line=20, column=20
text=cannot find symbol
symbol: variable kcontext
location: class defaultpkg.PDF.LambdaConsequenceDF24FCC3F13686A61CE2DA9AF55C71CF],
Message [id=2, level=ERROR,
path=src/main/java/defaultpkg/PDF/LambdaConsequenceDF24FCC3F13686A61CE2DA9AF55C71CF.java,
line=0, column=0
text=Java source of
src/main/java/defaultpkg/PDF/LambdaConsequenceDF24FCC3F13686A61CE2DA9AF55C71CF.java in
error:
...
public enum LambdaConsequenceDF24FCC3F13686A61CE2DA9AF55C71CF implements
org.drools.model.functions.Block1<java.util.List>,
org.drools.model.functions.HashedExpression {
...
@Override()
public void execute(java.util.List result) throws java.lang.Exception {
result.add(kcontext.getRule().getName());
}
}
]]
{noformat}
Note: The same issue is found in org.drools.mvel.integrationtests.KnowledgeContextTest
--
This message was sent by Atlassian Jira
(v8.13.1#813001)