You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "nagarajgond (via GitHub)" <gi...@apache.org> on 2025/12/03 06:58:16 UTC
[I] Parser throws exception if condition has number with leading zeros (DRL10) [incubator-kie-drools]
nagarajgond opened a new issue, #6539:
URL: https://github.com/apache/incubator-kie-drools/issues/6539
### Description
Below rule throws exception since it has leading zero with DRL10 parser. **Same rule works fine with DRL6 parser**.
```
package com.test.drl;
unit PolicyUnit;
rule "rule2"
salience -110
when
result: /results[ this != null ]
( /facts [ name == "hour_of_the_day", value < 02 ])
then
result.addFiredRule("rule2");
end
```
```
Exception in thread "main" org.kie.api.builder.CompilationErrorsException: Unable to create KieModule, Errors Existed: [Message [id=1, kieBase=defaultKieBase, level=ERROR, path=test/drl/rules/rule2.drl, line=8, column=0
text=no viable alternative at input '( /facts [ name == "hour_of_the_day", value < 02'], Message [id=2, kieBase=defaultKieBase, level=ERROR, path=test/drl/rules/rule2.drl, line=8, column=0
text=mismatched input '[' expecting {'unit', 'function', 'global', 'declare', 'trait', 'type', 'rule', 'query', 'when', 'then', 'end', 'and', 'or', 'exists', 'not', 'in', 'from', 'collect', 'accumulate', 'acc', 'init', 'action', 'reverse', 'result', 'entry-point', 'eval', 'forall', 'over', 'groupby', 'matches', 'memberOf', 'contains', 'excludes', 'soundslike', 'str', 'after', 'before', 'coincides', 'during', 'includes', 'finishes', 'finishedby', 'meets', 'metby', 'overlaps', 'overlappedby', 'starts', 'startedby', 'window', 'attributes', 'salience', 'enabled', 'no-loop', 'auto-focus', 'lock-on-active', 'refract', 'direct', 'activation-group', 'ruleflow-group', 'date-effective', 'date-expires', 'dialect', 'calendars', 'timer', 'duration', '?/', 'abstract', 'assert', 'boolean', 'break', 'byte', 'case', 'catch', 'char', 'class', 'const', 'continue', 'default', 'do', 'double', 'else', 'enum', 'extends', 'final', 'finally', 'float', 'for', 'if', 'goto', 'implements', 'import', 'insta
nceof', 'int', 'interface', 'long', 'native', 'package', 'private', 'protected', 'public', 'return', 'short', 'static', 'strictfp', 'super', 'switch', 'synchronized', 'this', 'throw', 'throws', 'transient', 'try', 'void', 'volatile', 'while', 'module', 'open', 'requires', 'exports', 'opens', 'to', 'uses', 'provides', 'with', 'transitive', 'var', 'yield', 'record', 'sealed', 'permits', 'non-sealed', '(', ';', '?', '/', IDENTIFIER}], Message [id=3, kieBase=defaultKieBase, level=ERROR, path=test/drl/rules/rule2.drl, line=0, column=0
text=Parser returned a null Package]]
at org.drools.compiler.kie.builder.impl.KieBuilderImpl.getKieModule(KieBuilderImpl.java:559)
at org.drools.compiler.kie.builder.impl.KieBuilderImpl.getKieModule(KieBuilderImpl.java:545)
```
### Tech stack
Java 21
Drools 10.1.0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [I] Parser throws exception if condition has number with leading zeros (DRL10) [incubator-kie-drools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on issue #6539:
URL: https://github.com/apache/incubator-kie-drools/issues/6539#issuecomment-3605537422
Thank you for reporting. I'm going to look at the issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [I] Parser throws exception if condition has number with leading zeros (DRL10) [incubator-kie-drools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on issue #6539:
URL: https://github.com/apache/incubator-kie-drools/issues/6539#issuecomment-3611033426
Fixed by https://github.com/apache/incubator-kie-drools/pull/6541
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [I] Parser throws exception if condition has number with leading zeros (DRL10) [incubator-kie-drools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas closed issue #6539: Parser throws exception if condition has number with leading zeros (DRL10)
URL: https://github.com/apache/incubator-kie-drools/issues/6539
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [I] Parser throws exception if condition has number with leading zeros (DRL10) [incubator-kie-drools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on issue #6539:
URL: https://github.com/apache/incubator-kie-drools/issues/6539#issuecomment-3610371423
It's a genuine bug. I will be fixed by https://github.com/apache/incubator-kie-drools/pull/6541 .
Note that leading zero number is octal digits. For example `013` in octal is `11` in decimal, which is the same as DRL6 and plain Java.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org