Drools 知识库 已弃用
我正在将 Drools 规则引擎集成到我的应用程序中。我发现的99%的入门示例如下所示:
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( ResourceFactory.newUrlResource( url ),
ResourceType.DRL );
if ( kbuilder.hasErrors() ) {
System.err.println( builder.getErrors().toString() );
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages( builder.getKnowledgePackages() );
StatefulKnowledgeSession ksession = knowledgeBase.newStatefulKnowledgeSession();
ksession.insert( new Fibonacci( 10 ) );
ksession.fireAllRules();
ksession.dispose();
我有类似的工作,但我的问题是被标记为已弃用,这对我来说是一个危险信号,表明我做错了。现在未标记为已弃用,但它也返回一个类型。KnowledgeBase
KnowledgeBaseFactory.newKnowledgeBase()
KnowledgeBase
那么,既然知识库已被弃用,我应该使用什么呢?