]
Jozef Marko moved RHDM-644 to DROOLS-2643:
------------------------------------------
Project: Drools (was: Red Hat Decision Manager)
Key: DROOLS-2643 (was: RHDM-644)
Workflow: GIT Pull Request workflow (was: CDW with docs v1)
Docs QE Status: NEW
Component/s: Guided Rule Editor
(was: Decision Central)
Affects Version/s: 7.8.0.Final
(was: 7.0.0.GA)
QE Status: NEW
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: Michael Anstis
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