I apologize, should have chosen my words better...<div><br>Drools does have &#39;logical assertion&#39; in the sense that a fact will be inserted and automatically retracted when it&#39;s conditions are no longer true.</div>
<div><br></div><div>I meant it in the sense of in JESS/CLIPS you can assert an non-structured template to trigger another rule (as in this message board question where the issue was how to cause a rule to fire when another rule fires)</div>
<div><br></div><div>JESS/CLIPS Example:</div><div>(deftemplate fire-my-special-rule) //Notice no structure of the template, its just an object called &#39;fire-my-special-rule&#39;</div><div><div><br></div><div>(defrule initial-rule</div>
<div>   (blah...blah...patterns which make the first rule fire)</div><div>    =&gt;</div><div>   (do some RHS actions)</div><div>   (assert (fire-my-special-rule))</div><div>)</div></div><div><br></div><div>(defrule special-rule</div>
<div>   (fire-my-special-rule) //here im just checking for the existance or truth of &#39;fire-my-special-rule&#39; </div><div>  =&gt;</div><div>    (RHS ACTIONS)</div><div>)</div><div><br></div><div>What i was getting at was, in JESS/CLIPS you can achieve what this question was asking by creating a deftemplate in the rule file that has no structure and use it to trigger another rule. In Drools you can not do this exactly, but if you created your own POJO &#39;flag&#39; that stores a string and a boolean, then you could store to the string &quot;fire-my-special-rule&quot; and set the boolean to TRUE. In your Drool DRL rule, check to see if the flag pojo has it&#39;s string value as &quot;fire-my-special-rule&quot; and boolean &quot;true&quot;.</div>
<div><br></div><div>Sorry, going on tangent, but yes i misspoke when i said Drools did not have Logical Assertions, it does. It just doesn&#39;t allow you to assert an unstructured template as does other rule engines do (which would have answered the original question in an easier / less hacked manner than my Flag POJO suggestion)</div>
<div><br><br><div class="gmail_quote">2010/8/22 Salaboy <span dir="ltr">&lt;<a href="mailto:salaboy@gmail.com">salaboy@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#FFFFFF"><div>Drools have logicalInsert, what do you mean with: drools doesn&#39;t have this? It behaves differently than Jess and clips? <br><br><div>- CTO @ <a href="http://www.plugtree.com" target="_blank"></a><a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com</a></div>
<div>- MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank"></a><a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a></div><div>- Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank"></a><a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a></div>
- Mauricio &quot;Salaboy&quot; Salatino -</div><div><div></div><div class="h5"><div><br>On 21/08/2010, at 23:53, Socrates Frangis &lt;<a href="mailto:soc.frangis@gmail.com" target="_blank">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 &quot;Flag&quot;, 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 &quot;rule-03-fired&quot; and set the boolean to &#39;true&#39;</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 &#39;rule-03-fired&#39; and &#39;true&#39;</div><div><br></div><div>Note, this is normally done in CLIPS/JESS as logical assertions, but Drools does not have this. However, i&#39;m sure it&#39;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" target="_blank"></a><a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</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><a href="mailto:sanjibk@skytechsolutions.co.in" target="_blank">sanjibk@skytechsolutions.co.in</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>

<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>&quot;Wolfgang Laun-2 [via
Drools - Java Rules Engine]&quot; &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 &quot;called&quot;. Changes in WM create
(and also delete) <br>
&quot;activations&quot;: 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" target="_blank">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" target="_blank">Nabble.com</a>.<br>

<br></div></div><div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank"></a><a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
</div><div><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank"></a><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>

<br></div></blockquote></div><br>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank"></a><a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank"></a><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></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" target="_blank">rules-users@lists.jboss.org</a></span><br>
<span><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a></span><br></div></blockquote></div></div></div><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></div>