]
Jozef Marko reassigned DROOLS-2643:
-----------------------------------
Assignee: Jozef Marko (was: Michael Anstis)
Extraneous parentheses generated by Guided Rule editor
------------------------------------------------------
Key: DROOLS-2643
URL:
https://issues.jboss.org/browse/DROOLS-2643
Project: Drools
Issue Type: Bug
Components: Guided Rule Editor
Affects Versions: 7.8.0.Final
Environment: RHDM 7.0.0.GA on Oracle JDK 1.8.0_172 on Mac OSX 10.13.5
Reporter: Jozef Marko
Assignee: Jozef Marko
Priority: Minor
Labels: Central, Decision, RHDM
The Guided Rule editor inserts extraneous parentheses in the generated DRL around the
phrase "(OrderLine : quantity > 0) from $o.orderlines)" as shown below:
package com.redhat.rhdm.demo;
import java.lang.Number;
rule "SpecialHandlingGuidedRule"
dialect "mvel"
when
$o : Order( orderlines.size() > 0 )
Number( intValue() > 100 ) from accumulate ( (OrderLine( $q : quantity > 0 )
from $o.orderlines)
,
sum($q))
then
end
This above DRL will fail to validate. If the extraneous parentheses are removed, as
shown below, then the DRL is valid.
package com.redhat.rhdm.demo;
import java.lang.Number;
rule "Assign Special Handling for Large Orders"
dialect "mvel"
when
$o : Order( orderlines.size() > 0 )
Number( intValue() > 100 )
from accumulate (OrderLine( $q : quantity > 0 ) from $o.orderlines,
sum($q))
then
$o.setIsSpecial( true )
end