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"><<a href="mailto:lzz313@sina.com">lzz313@sina.com</a>></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'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 "second" rule<br>
and "third" rule can'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 "first"<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=="server",operator=="operator",gameName=="gameName",createdDt<br>
> "2011-11-01",createdDt < "2011-11-30",points >= 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(),"first","S"));<br>
System.out.println("inserted activity type,"+"<br>
orderId="+$order.getId());<br>
end<br>
<br>
rule "second"<br>
salience 2<br>
when<br>
$activityType : ActivityType(name == "first",type == "S")<br>
$order:Order(id == $activityType.orderId,points == 240,amount >= 10)<br>
$user:User(id == $order.userId)<br>
then<br>
$user.setItem(new Item("aaa",1));<br>
end<br>
<br>
rule "third"<br>
salience 1<br>
when<br>
$activityType : ActivityType(name == "first", type == "S")<br>
$order:Order(points == 240, id == $activityType.orderId)<br>
$user:User(id == $order.userId)<br>
then<br>
$user.setItem(new Item("aaa",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>