<html><body bgcolor="#FFFFFF"><div>Drools have logicalInsert, what do you mean with: drools doesn't have this? It behaves differently than Jess and clips?&nbsp;<br><br><div>- CTO @ <a href="http://www.plugtree.com"><a href="http://www.plugtree.com">http://www.plugtree.com</a></a></div><div>- MyJourney @ <a href="http://salaboy.wordpress.com"><a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a></a></div><div>- Co-Founder @ <a href="http://www.jbug.com.ar"><a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a></a></div>- Mauricio "Salaboy" Salatino -</div><div><br>On 21/08/2010, at 23:53, Socrates Frangis &lt;<a href="mailto:soc.frangis@gmail.com">soc.frangis@gmail.com</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div>Keep in mind that rules are declarative, it is against the nature of a rule based expert system to force a rule to fire; youre kind of treating the rule like a function.<div><br></div><div>My best advice is....</div><div><br>
</div><div>1)Create a POJO called "Flag", store a String and Boolean inside of it.</div><div><br></div><div>2)On the RHS of the first rule, create the POJO and set the string to something like "rule-03-fired" and set the boolean to 'true'</div>
<div><br></div><div>3)In the rule you want to fire, add a pattern to check for a Flag Fact Template with String value 'rule-03-fired' and 'true'</div><div><br></div><div>Note, this is normally done in CLIPS/JESS as logical assertions, but Drools does not have this. However, i'm sure it's implemented the same on the back end.<br>
<br><div class="gmail_quote">2010/8/21 Michael Anstis <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com"><a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a></a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Look at the API; the overloaded method you use will only fire 2 rules.<br><br>You probably need fireAllRules();<br><br><div class="gmail_quote">2010/8/20 Sanjib Karmakar <span dir="ltr">&lt;<a href="mailto:sanjibk@skytechsolutions.co.in" target="_blank"><a href="mailto:sanjibk@skytechsolutions.co.in">sanjibk@skytechsolutions.co.in</a></a>&gt;</span><br>

<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div><div></div><div class="h5">

<br><font size="2" face="sans-serif">Sir</font>
<br>
<br><font size="2" face="sans-serif">Thank you very much for your reply.</font>
<br><font size="2" face="sans-serif">In fact what I wanted to execute the
specific rule out of say 10 rules.</font>
<br>
<br><font size="2" face="sans-serif">I have tried </font>
<br><font size="2" color="#0021bf" face="Courier New">ksession</font><font size="2" face="Courier New">.fireAllRules(2);</font>
<br><font size="2" face="sans-serif">Then only first 2 rules get executed.</font>
<br>
<br><font size="2" face="sans-serif">Please let me know if there is any way-out
to call specific rules out of bunch of rules.</font>
<br><font size="2" face="sans-serif">It would be extremely helpful if you
please share a code snippet regarding this.</font>
<br><font size="2" face="sans-serif"><br>
Regards<br>
Sanjib Karmakar<br>
SkyTech Solutions Pvt. Ltd<br>
<br>
Please consider the environment before printing this email.</font>
<br>
<br>
<br>
<table width="100%">
<tbody><tr valign="top">
<td width="40%"><font size="1" face="sans-serif"><b>"Wolfgang Laun-2 [via
Drools - Java Rules Engine]" &lt;<a href="http://user/SendEmail.jtp?type=node&amp;node=1238924&amp;i=0" rel="nofollow" target="_blank">[hidden email]</a>&gt;</b>
</font>
<p><font size="1" face="sans-serif">08/19/2010 07:45 PM</font>
</p></td><td width="59%">
<table width="100%">
<tbody><tr valign="top">
<td>
<div align="right"><font size="1" face="sans-serif">To</font></div>
</td><td><font size="1" face="sans-serif">Sanjib Karmakar &lt;<a href="http://user/SendEmail.jtp?type=node&amp;node=1238924&amp;i=1" rel="nofollow" target="_blank">[hidden email]</a>&gt;</font>
</td></tr><tr valign="top">
<td>
<div align="right"><font size="1" face="sans-serif">cc</font></div>
</td><td>
</td></tr><tr valign="top">
<td>
<div align="right"><font size="1" face="sans-serif">Subject</font></div>
</td><td><font size="1" face="sans-serif">Re: How Can a Drools Rule call another
Drools Rule?</font></td></tr></tbody></table>
<br>
<table>
<tbody><tr valign="top">
<td>
</td><td></td></tr></tbody></table>
<br></td></tr></tbody></table>
<br>
<br>
<br><font size="3">Rules are never "called". Changes in WM create
(and also delete) <br>
"activations": tuples consisting of a rule and the fact objects
<br>
matching the left hand side patterns. From this set of activations, <br>
rule right hand sides are executed according to salience (and other <br>
criteria). <br>
<br>
Perhaps if you describe the actual problem...? <br>
<br>
-W <br>
<br>
<br>
On 19 August 2010 06:58, Sanjib Karmakar &lt;</font><a href="http://user/SendEmail.jtp?type=node&amp;node=1225490&amp;i=0&amp;by-user=t" rel="nofollow" link="external" target="_blank"><font size="3" color="blue"><u>[hidden
email]</u></font></a><font size="3">&gt; wrote: </font>
<br><font size="3"><br>
&gt; <br>
&gt; Hi friends <br>
&gt; <br>
&gt; I would like to execute a rule say Rule-1 from inside another rule
say <br>
&gt; Rule-2. <br>
&gt; In project I am using xml and not drl, and I am using Drools 5.0 <br>
&gt; <br>
&gt; Please let me know how to call a rule from another rule. <br>
&gt; <br>
&gt; Thanks <br>
&gt; Sanjib <br>
&gt; -- <br>
&gt; View this message in context: </font><a href="http://drools-java-rules-engine.46999.n3.nabble.com/How-Can-a-Drools-Rule-call-another-Drools-Rule-tp1219190p1219190.html?by-user=t&amp;by-user=t" rel="nofollow" link="external" target="_blank"><font size="3" color="blue"><u>http://drools-java-rules-engine.46999.n3.nabble.com/How-Can-a-Drools-Rule-call-another-Drools-Rule-tp1219190p1219190.html</u></font></a><font size="3"><br>


&gt; Sent from the Drools - User mailing list archive at <a href="http://Nabble.com">Nabble.com</a>. <br>
&gt; _______________________________________________ <br>
&gt; rules-users mailing list <br>
&gt; </font><a href="http://user/SendEmail.jtp?type=node&amp;node=1225490&amp;i=1&amp;by-user=t" rel="nofollow" link="external" target="_blank"><font size="3" color="blue"><u>[hidden
email]</u></font></a><font size="3"> <br>
&gt; </font><a href="https://lists.jboss.org/mailman/listinfo/rules-users" rel="nofollow" link="external" target="_blank"><font size="3" color="blue"><u>https://lists.jboss.org/mailman/listinfo/rules-users</u></font></a><font size="3"><br>


&gt; </font>
<br><font size="3">_______________________________________________ <br>
rules-users mailing list </font><font size="3" color="blue"><u><br>
</u></font><a href="http://user/SendEmail.jtp?type=node&amp;node=1225490&amp;i=2&amp;by-user=t" rel="nofollow" link="external" target="_blank"><font size="3" color="blue"><u>[hidden
email]</u></font></a><font size="3"> </font><font size="3" color="blue"><u><br>
</u></font><a href="https://lists.jboss.org/mailman/listinfo/rules-users" rel="nofollow" link="external" target="_blank"><font size="3" color="blue"><u>https://lists.jboss.org/mailman/listinfo/rules-users</u></font></a><font size="3"><br>


</font>
<hr noshade="">
<br><font size="3" color="#666666">View message @ </font><a href="http://drools-java-rules-engine.46999.n3.nabble.com/How-Can-a-Drools-Rule-call-another-Drools-Rule-tp1219190p1225490.html?by-user=t" rel="nofollow" link="external" target="_blank"><font size="3" color="blue"><u>http://drools-java-rules-engine.46999.n3.nabble.com/How-Can-a-Drools-Rule-call-another-Drools-Rule-tp1219190p1225490.html</u></font></a><font size="3" color="#666666">
<br>
To unsubscribe from How Can a Drools Rule call another Drools Rule?, </font><a href="http://drools-java-rules-engine.46999.n3.nabble.com/template/NodeServlet.jtp?tpl=unsubscribe_by_code&amp;node=1219190&amp;code=c2Fuamlia0Bza3l0ZWNoc29sdXRpb25zLmNvLmlufDEyMTkxOTB8MTQzMDExODQ0MA==&amp;by-user=t" rel="nofollow" link="external" target="_blank"><font size="3" color="blue"><u>click
here</u></font></a><font size="3" color="#666666">. </font>
<br>
<br><hr width="300" align="left">
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/How-Can-a-Drools-Rule-call-another-Drools-Rule-tp1219190p1238924.html" target="_blank">Re: How Can a Drools Rule call another Drools Rule?</a><br>


Sent from the <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.html" target="_blank">Drools - User mailing list archive</a> at <a href="http://Nabble.com">Nabble.com</a>.<br>
<br></div></div><div class="im">_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank"><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></a><br>
</div><div class="im"><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank"><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></a><br>
<br></div></blockquote></div><br>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org"><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank"><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></a><br>
<br></blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>rules-users mailing list</span><br><span><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></span><br></div></blockquote></body></html>