good morning sir,<div><br></div><div>first of all</div><div>i am very thankful to your support,</div><div>but it is not working properly, first of all i want to explain my requirements</div><div>please pay little time for me</div>
<div><br></div><div>I have 1000 records of some data like sales amount</div><div><br></div><div>I have two rules like below</div><div><br></div><div><div>rule "Mr First Rule" </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>salience 100</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>when</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>#conditions</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>sales : Sales (salesAmount >=200)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>then </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>#actions</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>sales.set SalesMessage("goodsales");</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span> </div><div> end</div><div><br></div><div> rule "My second Rule" </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>salience 80</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>when</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>#conditions</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>sales : Sales (salesAmount<200)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>then </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>#actions</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>sales.set SalesMessage("badsales");</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span> </div><div> end</div></div><div><br></div><div><br></div><div>Here i want to insert facts from the list</div><div><br></div><div>if the salesAmount list is modified in the same session( fact object is modified)</div>
<div><br></div><div>how can i fire the rules again in the same session</div><div><br></div><div>please help me in this scenario and if possible please provide some docs also</div><div><br></div><div><br></div><div>regards </div>
<div>sai</div><div><br><br><div class="gmail_quote">On Thu, Oct 11, 2012 at 5:30 PM, abhinay_agarwal <span dir="ltr"><<a href="mailto:abhinay_agarwal@infosys.com" target="_blank">abhinay_agarwal@infosys.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you want the same rule to fire again and again then just modify the fact<br>
such that the WHEN condition is satisfied.<br>
<br>
For example in the HELLO WORLD sample Code :<br>
<br>
rule "Hello World"<br>
no-loop<br>
when<br>
m : Message( status == Message.HELLO, myMessage : message )<br>
then<br>
System.out.println( myMessage );<br>
m.setMessage( "Goodbye cruel world" );<br>
m.setStatus( Message.GOODBYE );<br>
update( m );<br>
end<br>
<br>
You can alter and change the m.setStatus( Message.HELLO) and you can see the<br>
rule gets refired again.<br>
<br>
But this will make the rule to refire itself again and again, making it fall<br>
inside an infinite loop, which is logically not acceptable(For this reason<br>
"no-loop" exists).<br>
<br>
So my opinion would be modify your rule set to make few rules, such that<br>
each of them satisfies under some condition and gets fired !!<br>
<br>
Regards,<br>
Abhinay<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/rules-users-firing-rules-twice-in-single-session-on-single-object-tp4020220p4020224.html" target="_blank">http://drools.46999.n3.nabble.com/rules-users-firing-rules-twice-in-single-session-on-single-object-tp4020220p4020224.html</a><br>
<div class="HOEnZb"><div class="h5">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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><strong>Regards</strong></div><div><strong><font size="4" face="garamond,serif" color="#6600cc">SAI BABA NADH</font></strong></div><div><p style="text-align:justify">
<font color="#6666cc" size="4" face="comic sans ms, sans-serif"><span style="line-height:14px">+91 7411680125</span></font></p></div><div></div><div><font color="#000066" face="garamond, serif" size="4"><b> </b></font></div>
<br><br><br>
</div>