<div>I think you may write a litte compiler to generate this rule of rules. ;)</div>
<div>or just write 5 templates.<br><br> </div>
<div><span class="gmail_quote">On 8/6/08, <b class="gmail_sendername">psentosa</b> <<a href="mailto:psentosa@yahoo.com">psentosa@yahoo.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Hi all,<br><br>This newbie has the following problem:<br><br>I'd like to let rules-creator to input something arbitrary, and the<br>
corresponding rules are produced.<br>To be concrete, he'd like to be able to write the following condition:<br><br>When<br> I play only on "Monday", "Thursday", "Friday"<br>Then<br>
I'll get 3000<br><br>But it should also be possible that he only inputs "Monday", or<br>"Monday","Tuesday","Wednesday","Thursday".<br>So the number of days to be input should be arbitrary.<br>
With my current understanding, I could only put some placeholders (in the<br>example above:<br><br>I play only on {day1} {day2} {day3} ..... --> $player : Player (1stday ==<br>{day1} && 2ndday == {day2} && 3rdday == {day 3})<br>
<br>I'll get {number} --> $player.setPayment(number)<br><br>Hope I explained this correctly...any tipps? Or should I really create on<br>template for 1 day only, another template for 2 days only, and so on?<br>Thanks a lot<br>
<br>--<br>View this message in context: <a href="http://www.nabble.com/How-to-create-DSL-template-that-produces-rules-based-on-arbitrary-user%27s-input--tp18850282p18850282.html">http://www.nabble.com/How-to-create-DSL-template-that-produces-rules-based-on-arbitrary-user%27s-input--tp18850282p18850282.html</a><br>
Sent from the drools - user 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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br>