This works for me:
StatefulKnowledgeSession session;
//...
KnowledgeBase kb = session.getKnowledgeBase();
for( KnowledgePackage kp: kb.getKnowledgePackages() ){
for( Rule r: kp.getRules() ){
System.out.println( "Rule: " + r.getName() );
}
}
-W
On Wed, Nov 25, 2009 at 5:23 PM, DeepakA <angeshwar(a)gmail.com> wrote:
So how can I access RuleBase from StatefulKnowledgeSession?
I cant find a API that links RuleBase and StatefulKnowledgeSession
interface.
I need to get hold of each individual rule from StatefulKnowledgeSession
DeepakA wrote:
>
> I used a KnowledgeBuilder ro read the resources (DSL & DSLR files)
> Then created a KnowledgeBase and created a StatefulKnowledgeSession out of
> the KnowledgeBase.
> The StatefulKnowledgeSession was used to start the process and fire all
> rules.
> Then I realized I was not able to access the RuleBase from
> StatefulKnowledgeSession.
>
>
> So, now I create a RuleBase, then a PackageBuilder, add the resources to
> the packageBuilder, then add the
> package to the RuleBase and create a StatefulSession out of the RuleBase.
> This statefulsession is used to start the process and fire all rules.
>
> Can someone explain to me whats the difference in the above 2 methods of
> firing the rules.
> Whats the difference between StatefulKnowledgeSession & StatefulSession.
>
--
View this message in context:
http://old.nabble.com/StatefulKnowledgeSession-Vs-StatefulSession-tp26511...
Sent from the drools - user mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users