<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.3603" name=GENERATOR></HEAD>
<BODY style="FONT-SIZE: 10pt; FONT-FAMILY: verdana">
<DIV><FONT face=Verdana><FONT size=2>I want increase user age by rule.But
ruleSet node trigge only one time.</FONT></FONT></DIV>
<DIV>When execute output:</DIV>
<DIV> new Usesr<BR>ageA: 0<BR>inc<BR>ageB: 1</DIV>
<DIV> </DIV>
<DIV>ageA: 1<BR>ageB: 1<BR>ageA: 1<BR>ageB: 1 </DIV>
<DIV>....</DIV>
<DIV>.....</DIV>
<DIV><FONT face=Verdana><FONT
size=2>rule:***************************</FONT></FONT></DIV>
<DIV> package t2.state</DIV>
<DIV> </DIV>
<DIV>import t2.state.User;<BR>import java.util.Map;<BR>import
java.util.HashMap;</DIV>
<DIV> </DIV>
<DIV>function Map createMap(String key,Object obj){<BR> Map m=new
HashMap();<BR> m.put(key,obj);<BR> return m;<BR>}</DIV>
<DIV> </DIV>
<DIV>rule "boot"<BR> dialect "mvel"<BR> when<BR> u :
User(age==0)<BR> then<BR> System.out.println(" new
Usesr");<BR> kcontext.getKnowledgeRuntime().startProcess("p1rf",createMap("user",u));<BR>end</DIV>
<DIV> </DIV>
<DIV>rule "inc user age"<BR> dialect "mvel"<BR> ruleflow-group "inc
age"<BR> no-loop true<BR> when<BR> u :
User();<BR> then<BR> System.out.println("inc");<BR> modify(u){age+=1};<BR>end<BR></DIV>
<DIV><FONT face=Verdana><FONT size=2></FONT></FONT> </DIV>
<DIV><FONT face=Verdana><FONT size=2>rule
flow:************************************</FONT></FONT></DIV>
<DIV><FONT face=Verdana> <?xml version="1.0"
encoding="UTF-8"?> <BR><process xmlns="<A
href="http://drools.org/drools-5.0/process">http://drools.org/drools-5.0/process</A>"<BR>
xmlns:xs="<A
href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</A>"<BR>
xs:schemaLocation="<A
href="http://drools.org/drools-5.0/process">http://drools.org/drools-5.0/process</A>
drools-processes-5.0.xsd"<BR>
type="RuleFlow" name="p1 rule flow" id="p1rf" package-name="t2.state"
><BR> <header><BR> <imports><BR> <import
name="t2.state.User"/><BR> </imports><BR> <variables><BR>
<variable name="user" ><BR> <type
name="org.drools.process.core.datatype.impl.type.ObjectDataType"
className="User" /><BR>
</variable><BR> </variables><BR> </header><BR> <BR> <nodes><BR> <start
id="1" name="Start"/><BR> <join id="2" name="Restart"
type="2"/><BR> <actionNode id="3"
name="changeAge"><BR> <action type="expression"
dialect="mvel">System.out.println("ageA:
"+user.age);</action><BR> </actionNode><BR> <ruleSet
id="4" name="user rule" ruleFlowGroup="inc
age"/><BR> <actionNode id="5"
name="changeAge"><BR> <action type="expression"
dialect="mvel">System.out.println("ageB:
"+user.age);System.in.read();</action><BR> </actionNode><BR> <split
id="6" name="decide"
type="2"><BR> <constraints><BR> <constraint
toNodeId="2" toType="DROOLS_DEFAULT" name="go to rest" type="rule" priority="1"
dialect="mvel">User(age &lt;
6)</constraint><BR> <constraint toNodeId="100"
toType="DROOLS_DEFAULT" name="go to end" type="rule" priority="2"
dialect="mvel">eval(true)</constraint><BR> </constraints><BR> </split><BR> <end
id="100"
name="End"/><BR> </nodes><BR> <BR> <connections><BR> <connection
from="1" to="2"/><BR> <connection from="2"
to="3"/><BR> <connection from="3"
to="4"/><BR> <connection from="4"
to="5"/><BR> <connection from="5"
to="6"/><BR> <connection from="6"
to="2"/><BR> <connection from="6"
to="100"/><BR> </connections><BR> <BR></process></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV align=left><FONT size=2>
<HR style="WIDTH: 122px; HEIGHT: 2px" SIZE=2>
</FONT></DIV>
<DIV><FONT color=#c0c0c0><FONT size=2>liuzhikun</FONT></DIV>
<DIV><FONT size=2>2009-10-30</FONT></FONT></DIV></FONT></BODY></HTML>