[jboss-jira] [JBoss JIRA] (DROOLS-4902) Can not use mod operators (%) in when clause.
xb l (Jira)
issues at jboss.org
Mon Jan 6 07:10:09 EST 2020
[ https://issues.redhat.com/browse/DROOLS-4902?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
xb l updated DROOLS-4902:
-------------------------
Summary: Can not use mod operators (%) in when clause. (was: Can not use mod operators (%) in when clouse.)
> Can not use mod operators (%) in when clause.
> ---------------------------------------------
>
> Key: DROOLS-4902
> URL: https://issues.redhat.com/browse/DROOLS-4902
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.31.0.Final
> Reporter: xb l
> Assignee: Mario Fusco
> Priority: Major
>
> When I study drools , I write a rule use divide operator
> {code:java}
> rule "Buzz" salience 2
> when
> $n: Number( this / 5 == 3 )
> then
> System.out.println("Buzz");
> end
> {code}
> It's OK.
> But:
> {code:java}
> rule "Buzz" salience 2
> when
> $n: Number( this % 5 == 0 )
> then
> System.out.println("Buzz");
> end
> {code}
> Report parser error: Unable to Analyse Expression this % 5 == 0:
> The drools document mentioned the same example:
> Person( age > 100 && ( age % 10 == 0 ) )
> % is Multiplicative operators, why parser error?
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list