]
Siyad Theyparambil Mohammed commented on DROOLS-1416:
-----------------------------------------------------
HI [~mfusco]
Could you please let us know if we have ConditionalBranchDescr support in drl.mvel ?
DRL Dumper Not Printing the content of ConditionalBranch
--------------------------------------------------------
Key: DROOLS-1416
URL:
https://issues.jboss.org/browse/DROOLS-1416
Project: Drools
Issue Type: Bug
Components: tools
Affects Versions: 6.4.0.Final
Reporter: Siyad Theyparambil Mohammed
Assignee: Mario Fusco
While trying to use conditionalbranch api for handling multiple if-then blocks, the DRL
dumper is not printing the content we have used for conditionalbranch. Please find the
sample code below and the restuls
*+Code+*
PackageDescr pkg = DescrFactory.newPackage()
.name( "org.drools.compiler" )
.newRule().name( "test" )
.lhs()
.pattern("Cheese").constraint( "type ==
\"stilton\"" ).end()
.conditionalBranch()
.condition().constraint("price <
10").end()
.consequence().name("c1").end()
.end()
.pattern("Cheese").constraint( "type ==
\"cheddar\"" ).end()
.conditionalBranch()
.condition().constraint("price > 10").end()
.consequence().name("c2").end()
.end()
.end()
.rhs( "// do something" )
.namedRhs( "c1", "// do something else\n" )
.end()
.getDescr();
return new DrlDumper().dump( pkg );
*+Output+*
package org.drools.compiler
rule "test"
when
Cheese( type == "stilton" )
Cheese( type == "cheddar" )
then
// do something
then[c1]
// do something else
end
In the above example the content "price < 10" and "price > 10"
which we have used for conditionalBranch is not getting printed. On further investigation
we found the drl.mvel template does not have the import
org.drools.compiler.lang.descr.ConditionalBranchDescr.