Sure, look at using Templates.<br><br><div class="gmail_quote">On 2 April 2012 15:18, Tim van Heugten <span dir="ltr">&lt;<a href="mailto:stimme@gmail.com">stimme@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br><br>I&#39;m new to Drools, and wonder how I can most cleanly write down rules for the following.<br><br>(For the sake of example) Say I have an object that needs to be processed season-dependent. I basically need a rule like:<br>


rule<br>    when<br>        Date( month == X, day &gt;= Y, day &lt;= Z)<br>        // Some date containing object<br>    then<br>        System.out.println(&quot;Season is &quot;+R)<br>        // Store season in associated object<br>


end<br><br>And fill in X, Y, Z and R with: <br clear="all">X    Y    Z    R<br>1    1    31    Winter<br>2    1    29    Winter<br>3    1    21    Winter<br>3    22    31    Spring<br>4    1    30    Spring<br>5    1    31    Spring<br>


6    1    21    Spring<br>6    22    30    Summer<br>7    1    31    Summer<br>...<br><br><br>Should I expand all this rules by hand, and define 16 rules in my rule file? Or can I parametrize the rules and have this done automagically?<br>


<br>Thanks a lot,<br><br>Tim van Heugten<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>