I want to build a excel decision table to implement the logic described as the following drl script:<br><br>======<br><br>global pricebook.PricingResult result;<br><br>rule "pricing"<br>when<br> $so : SalesOrder( <a href="http://customer.name">customer.name</a>=="customer1", from == "location1", to =="location2")<br>
<b>$sol : SalesOrderLine($sol.count >= 0, $sol.count < 100) from $so.lines </b><br>then<br> result.setPricingMode("A");<br> result.setUnitPrice(300.0f);<br>end<br>======<br><br>The java model for the script above is something like this:<br>
<br>======<br>class SalesOrder{<br> ...<br> List<SalesOrderLine> lines;<br> ...<br>}<br>======<br><br>In the excel decision table, I defined variables with the following text in excel cells:<br>======<br>$so : SalesOrder <br>
<b>$sol : SalesOrderLine ( ) from so.lines</b><br>...<br>======<br><br>The CONDITION column is defined as :<b> $sol.count >= $1, $sol.count < $2</b><br><br><br>The decision table is translated into the following drl script:<br>
<br>global pricebook.PricingResult result;<br><br>rule "pricing"<br>when<br> $so : SalesOrder( <a href="http://customer.name">customer.name</a>=="customer1", from == "location1", to =="location2")<br>
<b> $sol : SalesOrderLine from $so.lines($sol.count >= 0, $sol.count < 100) </b><br>then<br> result.setPricingMode("A");<br> result.setUnitPrice(300.0f);<br>end<br><br>We can see that<b> "$soi : SalesOrderLine ( ) from so.lines"</b> in the excel decision table is translated into<b> "$sol : SalesOrderLine from $so.lines($sol.count >= 0, $sol.count < 100)" </b> instead of <b>"$sol : SalesOrderLine($sol.count >= 0, $sol.count < 100) from $so.lines"</b>, which causes an error.<br>
<br>My question is, how to write the variable definition of SalesOrderLine in excel so that drools can translate it into something like "$sol : SalesOrderLine($sol.count >= 0, $sol.count < 100) from $so.lines " ?<br>
<br>Any ideas? <br><br>Thanks in advance...<br>