So the date the original booking was taken controls which price rules need be applied?<br><br>Why not add &quot;date range in which these rules apply&quot; patterns to the rules, and have each product hold a reference to their original purchase\order date:-<br>
<br>In DRL form:-<br><br><span style="font-family: courier new,monospace;">rule &quot;1-Jan-2011 to 31-Mar-2011&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">when</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  DateRanges( $df : startDate, $de : endDate, rule==&quot;version1&quot; )</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Product( purchaseDate &gt;= $df &amp;&amp; &lt; $de )</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  ..</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  ..</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">end</span><br style="font-family: courier new,monospace;"><br>DateRanges contains date ranges for versions of the rules.<br><br>You keep all versions of rules in session. <br>
<br>My 2 cents.<br><br><div class="gmail_quote">On 18 April 2011 10:04, Riyaz Saiyed <span dir="ltr">&lt;<a href="mailto:Riyaz.saiyed@emirates.com">Riyaz.saiyed@emirates.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Ok, here is the scenario.<br>
<br>
If the selected product is “Product A”,<br>
         If the adult count is between 1 and 5<br>
                 Then price should be 50 USD per person.<br>
         If adult count is between 6 and 10 the price<br>
                 Then the price should be 600 USD per group<br>
<br>
<br>
Now when the first time the product is booked for 5 adults, get the price 50<br>
* 5 = 250 USD.<br>
<br>
In between price rule has been modified ad following.<br>
<br>
If the selected product is “Product A”,<br>
       If the adult count is between 1 and 5<br>
             Then price should be 40 USD per person.<br>
       If adult count is between 6 and 10 the price<br>
             Then the price should be 700 USD per group<br>
<br>
When the next time the order is modified change the adult count and<br>
      If the adult count is increased from 5 to 8, it should re-calculate<br>
the price to 600 USD as per previous rule.<br>
      Or<br>
      If the adult count is decreased from 5 to 3, it should re-calculate<br>
the price to 3 * 50 = 150 USD<br>
<br>
<br>
Thanks,<br>
Riyaz<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Drools-Decision-Table-tp2830218p2833582.html" target="_blank">http://drools.46999.n3.nabble.com/Drools-Decision-Table-tp2830218p2833582.html</a><br>

</font><div><div></div><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</div></div></blockquote></div><br>