There is a subsection called &quot;Rule Templates&quot; in the Expert manual which might<br>help you solve your problem. (Also, the following section on &quot;Templates&quot; should<br>be informative.) Taking just the parameters from the XLS and supplying either<br>
set of rules via templates might be the best way to go.<br><br>Notice that another approach could be to create objects from the parameter<br>sets users create for the &quot;first&quot; set of rules. (Here some XLS reading would have<br>
to be used - see the source code in Drools.) You can (see section &quot;Templates&quot;)<br>create rules from these objects. Also, you could insert them as facts and<br>run simple generic rules to contrast them to another set of facts taken from<br>
the data base, e.g.<br><br>  rule &quot;must have article no<br>  when<br>      ParamFact( $artNo: artNo )<br>      not DataFact( artNo == $artNo )<br>  then<br>      // no such article number<br>  end<br><br>-W<br><br><div class="gmail_quote">
On 6 March 2011 00:28, groovenarula <span dir="ltr">&lt;<a href="mailto:gnarula1@la-z-boy.com">gnarula1@la-z-boy.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Manstis,<br>
<br>
You are correct. There are parameters that users will provide in the<br>
spreadsheet that I need to validate. Actually there will be one spreadsheet.<br>
It&#39;s going to serve 2 purposes. Provide a decision table AND also be a<br>
container of data for a few Rule Templates. The concept is that if a product<br>
does not match any criteria on the spreadsheet, then the next step is to<br>
extract the data from the spreadsheet and create rules where the match would<br>
be more &#39;generic&#39;. So I&#39;m planning to use the decision table to deduce the<br>
more &#39;generic matching conditions&#39;. In both cases, I need to be able to<br>
validate the parameters in the spreadsheet against values in a data table.<br>
<br>
Taking my earlier example - The user might provide product attributes - e.g.<br>
product number ABC510 in the spreadsheet. I have to ensure that the ABC510<br>
is a valid product number before I can allow the spreadsheet to be used as<br>
the source of my rules (the actual rules will determine the price that will<br>
be charged for the product).<br>
<br>
I&#39;ll be able to easily create a new set of rules to validate the product<br>
information against the data table we have. That should not pose a major<br>
problem. The question is how to easily convert the spreadsheet into an<br>
arraylist of facts that I can insert into this rule set. I know I can<br>
&#39;program&#39; this manually using POI etc. I&#39;m looking to see if there&#39;s a less<br>
fragile way to load the spreadsheet as facts ? If there is a quicker way,<br>
I&#39;d love to hear about it.<br>
<br>
Hope that makes more sense and is a little clearer than mud :).<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/How-to-validate-literal-values-on-the-LHS-of-rules-tp2638081p2639892.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/How-to-validate-literal-values-on-the-LHS-of-rules-tp2638081p2639892.html</a><br>

</font><div><div></div><div class="h5">Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>