[jboss-jira] [JBoss JIRA] (DROOLS-1619) Compile error on a multibyte-name variable as a positional query parameter
Toshiya Kobayashi (JIRA)
issues at jboss.org
Tue Jun 20 03:23:00 EDT 2017
Toshiya Kobayashi created DROOLS-1619:
-----------------------------------------
Summary: Compile error on a multibyte-name variable as a positional query parameter
Key: DROOLS-1619
URL: https://issues.jboss.org/browse/DROOLS-1619
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.1.0.Beta2
Reporter: Toshiya Kobayashi
Assignee: Mario Fusco
Drools raises a compile error on a multibyte-name variable as a positional query parameter.
{noformat}
query testquery(int $a, Person $t)
$t := Person(age > $a)
end
rule "hoge"
when
testquery(30, $あああ;)
then
System.out.println($あああ.getName());
end
{noformat}
{noformat}
java.lang.RuntimeException: Error while creating KieBase[Message [id=1, kieBase=defaultKieBase, level=ERROR, path=Sample.drl, line=11, column=0
text=Unable to compile expression: $あああ], Message [id=2, kieBase=defaultKieBase, level=ERROR, path=Sample.drl, line=9, column=0
text=Rule Compilation error $あああ cannot be resolved]]
at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:527)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:687)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:629)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:611)
at com.sample.DroolsTest.main(DroolsTest.java:18)
{noformat}
It is considered as "not variable" in QueryElementBuilder.isVariable() since BRMS 6.4.
https://github.com/kiegroup/drools/blob/6.5.x/drools-compiler/src/main/java/org/drools/compiler/rule/builder/QueryElementBuilder.java#L421
https://github.com/kiegroup/drools/blob/6.5.x/drools-core/src/main/java/org/drools/core/util/StringUtils.java#L1152-L1155
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list