Drools reusability issues?

For more details, go to downloads.jboss.com/drools/docs/5.1.1.34... chapter 2.1.2. Stateful Knowledge Session.

Good way of doing this is using agenda-group. Other way is, separate your rules package wise. As I under stand your question, you can use Fact Handles.

Use StatefullKnowledgeSession here. FactHandle objHandle = ksession. Insert( fact ); After while, when your facts are ready from database, you can modify the facts in current running session.Ksession.

Update(objHandle, newFactObject(of same class)) For more details, go to downloads.jboss.com/drools/docs/5.1.1.34... chapter 2.1.2. Stateful Knowledge Session.

Thanks for your prompt reply :) For 1. I'm hoping to find a way to choose rules to fire programmatically - I will have to modify the rule files if use agenda-group. Separating rules package can be clumsy as I have to change the classpath (to load the rules) of the affected Java classes.

For 2. Thank for sharing about the facthandle. But if the facts from database came in after the knowledge session completed its run?

In that sense, I will still have to wait for all the data are available before firing the rule engine correct me if I'm wrong. – Style Jan 13 '11 at 6:32 1. Separate rule by package doesn't mean that you put your rules in different packages. Rule package is just a name of group that contains multiple rule.

You can build different rule base for different purpose with different rule packages(one or more). 2. StateFullKnowledgeSession require to dispose manually.

So until you don't have your facts from database, you can keep session running. An then dispose it manually. If it takes more time to get facts from database then you should create new session.

– nIKUNJ Jan 13 '11 at 6:55 For 1. Yup I understood the rule package though I prefer more granular control over the firing of rules (e.g. , using Java code, load a rule file and fire just this rule). Thanks, I think I got the idea :) For 2, I've overlooked the point about StateFullKnowledgeSession require to dispose manually, saw also that knowledge sessions can be persisted, probably going with the design of persisting sessions until facts from database are ready then resume sessions.

– Style Jan 13 '11 at 8:50.

After while, when your facts are ready from database, you can modify the facts in current running session.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions