<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi John, this is a known issue
<a class="moz-txt-link-freetext" href="https://issues.jboss.org/browse/JBRULES-2718">https://issues.jboss.org/browse/JBRULES-2718</a>. The fix is in
5.2.0.CR1 which you can get from
<a class="moz-txt-link-freetext" href="http://www.jboss.org/drools/downloads.html">http://www.jboss.org/drools/downloads.html</a>. <br>
<br>
Thanks.<br>
On 5/27/11 12:14 PM, John Peterson wrote:
<blockquote
cite="mid:C08AF06BE8CE7E44B74ECE1BDB008D0201DFFD@WPSDGQGP.OPR.STATEFARM.ORG"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
<font face="Calibri" size="2"><span style="font-size: 11pt;">
<div>I’m having some difficulty getting a rule flow with a
stateless session to work. Essentially, it is just
executing the first task and then stops. I’m using Drools
5.1.1 and I just built the sample Drools by creating a new
Drools Project.</div>
<div><font face="Times New Roman"> </font></div>
<div>My rule flow is simple: Start-RuleGroup1-RuleGroup2-End</div>
<div> </div>
<div>I use the 2 rules from example, putting the “Hello World”
in RuleGroup1 and “Goodbye” in RuleGroup2.</div>
<div> </div>
<div>Here’s my code to run it:</div>
<div> </div>
<div><font color="#3f7f5f" face="Courier New" size="2"><span
style="font-size: 10pt;">// load up the knowledge base</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:
10pt;">KnowledgeBase kbase = <i>readKnowledgeBase</i>();</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:
10pt;">StatelessKnowledgeSession ksession =
kbase.newStatelessKnowledgeSession();</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:
10pt;">KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.<i>newFileLogger</i>(ksession,
<font color="#2a00ff">"test"</font>);</span></font></div>
<div><font color="#3f7f5f" face="Times New Roman"> </font></div>
<div><font color="#3f7f5f" face="Courier New" size="2"><span
style="font-size: 10pt;">// start a new process instance</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:
10pt;">Message message = <font color="#7f0055"><b>new</b></font>
Message();</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:
10pt;">message.setMessage(<font color="#2a00ff">"Hello
World"</font>);</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:
10pt;">message.setStatus(Message.<font color="#0000c0"><i>HELLO</i></font>);</span></font></div>
<div><font face="Times New Roman"> </font></div>
<div><font face="Courier New" size="2"><span style="font-size:
10pt;">ArrayList cmds = <font color="#7f0055"><b>new</b></font>
ArrayList();</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:
10pt;">ArrayList dataList = <font color="#7f0055"><b>new</b></font>
ArrayList();</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:
10pt;">dataList.add(message);</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:
10pt;">cmds.add(CommandFactory.<i>newInsertElements</i>(dataList));</span></font></div>
<div><font face="Times New Roman"> </font></div>
<div><font face="Courier New" size="2"><span style="font-size:
10pt;">cmds.add(CommandFactory.<i>newStartProcess</i>(<font
color="#2a00ff">"com.sample.ruleflow"</font>));</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:
10pt;">ksession.execute(CommandFactory.<i>newBatchExecution</i>(cmds));</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:
10pt;">logger.close();</span></font></div>
<div><font face="Times New Roman"> </font></div>
<div>When I run the rules, all I get is “Hello World” (no
“Goodbye cruel world”). It does work with a Stateful
Session using insert, startProcess, and fireAllRules, but
this is a test using the rule flows with CommandFactory
functionality, something we need
for an application we are developing.</div>
<div><font face="Times New Roman"> </font></div>
</span></font>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>