[rules-users] Rule Flow and Stateless Session

Tihomir Surdilovic tsurdilo at redhat.com
Fri May 27 14:28:01 EDT 2011


Hi John, this is a known issue 
https://issues.jboss.org/browse/JBRULES-2718. The fix is in 5.2.0.CR1 
which you can get from http://www.jboss.org/drools/downloads.html.

Thanks.
On 5/27/11 12:14 PM, John Peterson wrote:
> 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.
> My rule flow is simple: Start-RuleGroup1-RuleGroup2-End
> I use the 2 rules from example, putting the "Hello World" in 
> RuleGroup1 and "Goodbye" in RuleGroup2.
> Here's my code to run it:
> // load up the knowledge base
> KnowledgeBase kbase = /readKnowledgeBase/();
> StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
> KnowledgeRuntimeLogger logger = 
> KnowledgeRuntimeLoggerFactory./newFileLogger/(ksession, "test");
> // start a new process instance
> Message message = *new* Message();
> message.setMessage("Hello World");
> message.setStatus(Message./HELLO/);
> ArrayList cmds = *new* ArrayList();
> ArrayList dataList = *new* ArrayList();
> dataList.add(message);
> cmds.add(CommandFactory./newInsertElements/(dataList));
> cmds.add(CommandFactory./newStartProcess/("com.sample.ruleflow"));
> ksession.execute(CommandFactory./newBatchExecution/(cmds));
> logger.close();
> 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.
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110527/963d2227/attachment.html 


More information about the rules-users mailing list