<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">All,<div><br></div><div>I saw this question was asked a couple of months ago with no reply, but thought I would try again.</div><div><br></div><div>In using a Rule Template, I'm trying to determine a way to dynamically generate rules based on a value in the data.</div><div><br></div><div>There is a data set, that has various pieces data, depending on a column value, the rule that is generated is relatively different. &nbsp;Different enough that I wouldn't want the generated a rule for each row of data, because many of the rules generated would never fire.</div><div><br></div><div>In the drools expert docs, it lists under 6.1.7 Rule Templates the ability to "conditionally generate rules based on the values in the data", but I can't seem to find the syntax for how to do that.</div><div><br></div><div>Does anyone know the answer to this?</div><div><br></div><div>I would picture it looking something like this</div><div><br></div><div>if ("@{RevenueCode}" == "NR")</div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco; ">rule "RevenueMapperRule_1"</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; ">when</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>claim1 : ClaimFact (ProgramType in ("FC", "FCP", "FALSE", "FALSE"),</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                                        </span>ProcedureCode == "NR",</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                                        </span>(serviceBegin &gt;= "01-Oct-2003" &amp;&amp; serviceBegin &lt;= "31-Dec-2030"),</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                                        </span>modifier1 in ("U"),</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">                                        </span>typeofBill == "3");</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; ">then</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>claim1.setResultSPCCode("507.11");</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>list.add(claim1);</div><div style="margin: 0px; font-size: 11px; font-family: Monaco; ">end</div></div><div>end if</div><div><br></div><div>Essentially, the only time this rule would be generated is if RevenueCode in the Rules Spreadsheet had a value of "NR".</div><div><br></div><div>If this is not possible, how should I be thinking about this problem? &nbsp;Feels weird to generate a bunch of rules that will never fire, simply because there is no way to conditionally generate a rule. &nbsp;Maybe the answer is to create separate rule files and template definitions? &nbsp;That also feels like an over complication.</div><div><br></div><div>Thoughts?</div><div><br></div><div>Thanks in advance!</div><div><br></div></body></html>