You can have a fact that stores those values:<div><br></div><div><meta charset="utf-8">rule "Check Age"<br> when</div><div> Context($ageLimit : age)<br> Person(age > $ageLimit)<br>
then<br> do something...<br>end<br><br><div class="gmail_quote">On Tue, May 24, 2011 at 6:33 PM, marunam <span dir="ltr"><<a href="mailto:sutavis@gmail.com">sutavis@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br>
<br>
I have a question about having dynamic LHS in drool rules. Below is what I<br>
am looking for<br>
<br>
rule "Check Age"<br>
when<br>
Person(age > 24)<br>
then<br>
do something...<br>
end<br>
<br>
What is the best way to keep the actual fact data dynamic(i.e. 24 in this<br>
case) and how do I feed it do drools<br>
This is very simple rule and the only fact value(hardcoded) that I have is<br>
"24". I may have complex rules in which I could have many fact values for<br>
different attributes. I am looking for a solution where I don't hard code<br>
any value in the rule<br>
<br>
Thank you for looking into this and your response<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/drools-dynamic-LHS-tp2980536p2980536.html" target="_blank">http://drools.46999.n3.nabble.com/drools-dynamic-LHS-tp2980536p2980536.html</a><br>
Sent from the Drools: User forum 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>
</font></blockquote></div><br></div>