Do you insert a User Fact too?<br><br>Perhaps seeing the Java side of your code will help.<br><br><div class="gmail_quote">On 11 November 2011 08:18, luke <span dir="ltr">&lt;<a href="mailto:lzz313@sina.com">lzz313@sina.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
When I insert fact to working memery in the rule file, others rule some time<br>
can&#39;t be fired.<br>
<br>
I use the drools rule version is 5.3.0.Final<br>
<br>
call rule engine in java and loop 100,then has 1-3 times the &quot;second&quot; rule<br>
and &quot;third&quot; rule can&#39;t be fired.<br>
<br>
rule file:<br>
package com.sample<br>
<br>
import com.sample.pojo.Order<br>
import com.sample.pojo.User<br>
import com.sample.pojo.Item<br>
<br>
declare ActivityType<br>
        orderId : String<br>
        name : String<br>
        type : String<br>
end<br>
<br>
<br>
rule &quot;first&quot;<br>
        no-loop true<br>
        salience 100<br>
    when<br>
    $user:User()<br>
        $order:Order(userId ==<br>
$<a href="http://user.id" target="_blank">user.id</a>,server==&quot;server&quot;,operator==&quot;operator&quot;,gameName==&quot;gameName&quot;,createdDt<br>
&gt; &quot;2011-11-01&quot;,createdDt &lt; &quot;2011-11-30&quot;,points &gt;= 240)<br>
    not Order(userId == $<a href="http://user.id" target="_blank">user.id</a>,id != $<a href="http://order.id" target="_blank">order.id</a>)<br>
    then<br>
    drools.insert(new ActivityType($order.getId(),&quot;first&quot;,&quot;S&quot;));<br>
    System.out.println(&quot;inserted activity type,&quot;+&quot;<br>
orderId=&quot;+$order.getId());<br>
end<br>
<br>
rule &quot;second&quot;<br>
        salience 2<br>
    when<br>
        $activityType : ActivityType(name == &quot;first&quot;,type == &quot;S&quot;)<br>
        $order:Order(id == $activityType.orderId,points == 240,amount &gt;= 10)<br>
    $user:User(id == $order.userId)<br>
    then<br>
        $user.setItem(new Item(&quot;aaa&quot;,1));<br>
end<br>
<br>
rule &quot;third&quot;<br>
        salience 1<br>
        when<br>
                $activityType : ActivityType(name == &quot;first&quot;, type == &quot;S&quot;)<br>
                $order:Order(points == 240, id == $activityType.orderId)<br>
                $user:User(id == $order.userId)<br>
        then<br>
                $user.setItem(new Item(&quot;aaa&quot;,1*$order.getQuality()));<br>
end<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/When-I-insert-fact-to-working-memery-in-the-rule-file-others-rule-some-time-can-t-be-fired-tp3499083p3499083.html" target="_blank">http://drools.46999.n3.nabble.com/When-I-insert-fact-to-working-memery-in-the-rule-file-others-rule-some-time-can-t-be-fired-tp3499083p3499083.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></span></blockquote></div><br>