我使用Drools-guvno5.5存储规则,并使用进行修改。我想在java中创建一个示例应用程序,它与drools连接,并从它加载规则,并在java端执行。为此,我遵循了如下步骤。
我在drools--专家文档中看到,"KnowledgeAgent“用于将java应用程序与drools连接起来,但我无法找到这方面的任何示例代码。
有人能帮我解决这个问题吗。
发布于 2013-11-11 09:10:10
创建知识代理的示例代码在Drools专家用户指南中。
single/#d0e2239
下面是手册该部分中代码的注释版本。
// Create a knowledge agent which will poll a Guvnor URL every 60 secs.
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyAgent" );
kagent.applyChangeSet( ResourceFactory.newUrlResource( url ) );
// Call this when your application wishes to run rules.
// By calling getKnowledgeBase(), you will get the most recent
// knowledge base from the agent.
KnowledgeBase kbase = kagent.getKnowledgeBase(); https://stackoverflow.com/questions/19899879
复制相似问题