[rules-users] How to continue session, but remove all objects?

saynyshy saynyshy at gmail.com
Wed Dec 15 10:14:28 EST 2010


Sorry, I couldn't explain it correctly (first time you understand me correct)

So, please see the code (no it was really realised as you said before ->
every time start new session but...)
I'l try to show example:


private KnowledgeBase kbase;
...
kbase = readKnowledgeBase(ruleflowfileSheme, rulefileslistDrl);
kbase.newStatefulKnowledgeSession();
...

I need to check some Persons in rules: 

List<Person>ls

for(Person p:ls){

check(p);

}

I'm using method 

public boolean check(Person p){
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
...
		ksession.insert(p);
		ksession.startProcess(this.file);
		ksession.fireAllRules();
		ksession.dispose();

		// here i need remove all objects from memory (all drools.insert's etc) &
p too...
		return false;
}



Every time I use new session, because i can't remove all objects from memory
after (current checked list element) 
Person p was checked in all rules. How can I do this????

-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-continue-session-but-remove-all-objects-tp2090965p2092517.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list