Why are you writing it using Drools? Will you also have a lot of other rules in your system? If the answer is no, you may want to go another route.<br><br>If the answer is yes, I would suggest contraining the No of purchase so there are no overlapping ranges, i.e. No Pens Purchased >=10, >=5 < 10, and >=2 and < 5. Also, have a summary or some other object that the LHS matches, then the RHS of these rules updates to subtract the number required for a free item. <br>
<br><div class="gmail_quote">On Tue, Jan 27, 2009 at 9:41 AM, niraj manandhar <span dir="ltr"><<a href="mailto:regniraj@gmail.com">regniraj@gmail.com</a>></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;">
<br><div class="gmail_quote"><br><br>Dear Sir<br>Thanks for the answer by the way is there any way to slove my free item problem .<br><br>I want to make a decison table in excel where my client will fill in the item and free item list as<br>
<br><br>Purchased ITem No of purchase Free Item No of free<br>
==========================================================<br>Pen 2 Rubber 1<br>Pen 5 Pencil 1<br>
Pen 10 Pencil 3<br>Pen 12 Pencil 4<br>Ink bottle 3 Sticker 1<br>
Ink bottle 5 Sticker 2<br>Ink Bottle 10 Sticker 5<br><br><br>When a customer buys 19 pen then<br>
his free item will be<br>4 pencil (due to first 12 pens)<br>5 pencil (due to remaining 5 pens)<br>1 rubber (due to 2 pens) <br><br>I have been trying to write the rule and fit into excel since from 1 week but due to my limited knowledge of drl and decision tables in excel it is taking a lot of time than writing code with lookup table and JAVA if else<br>
<br>Please help me to slove this riddle <br><br><br><br>Thanks<br><font color="#888888">Niraj<br><br><br><br><br><br>
</font></div><br>
<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>
<br></blockquote></div><br>