[rules-users] Drools Flow within Stateless Session in Drools 5.1

JeffMax jeffmax at gmail.com
Fri Dec 17 09:37:18 EST 2010


Hi,

I have investigated this a little further. Since a stateless session uses a
stateful session internally, I compared the code in the stateless session
implementation that instantiates a stateful session to the regular stateful
session instantiation code. 

In the file StatelessKnowledgeSessionImpl.java, there is a function called
newWorkingMemory(), with the following code:

StatefulKnowledgeSessionImpl ksession = new StatefulKnowledgeSessionImpl(
wm,
                                                                                                  
new KnowledgeBaseImpl( this.ruleBase ) );
             
                         ((Globals) wm.getGlobalResolver()).setDelegate(
this.sessionGlobals );
                         wm.setKnowledgeRuntime( ksession );
                         wm.setWorkingMemoryEventSupport(
this.workingMemoryEventSupport );
                         wm.setAgendaEventSupport( this.agendaEventSupport
);
                         wm.setRuleFlowEventSupport(
this.ruleFlowEventSupport );

I noticed that if I comment out the last line that calls
setRuleFlowEventSupport, both stateless and stateful sessions work the same
with the test case I described in this post. Does anyone have any idea why
this would be, or what other effects not calling that function will have? 

The background on this is that I am implementing a decision support web
service, where each request is independent. I am interested in the
difference between using a stateless session, and just creating a new
stateful session for each request.

Thanks,

Jeff
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-within-Stateless-Session-in-Drools-5-1-tp2094451p2105016.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list