简体   繁体   English

Java代码访问Drools Guvnor

[英]java code to access drools guvnor

我们有一个项目要求,可以通过Web应用程序访问guvnor。有人可以让我知道如何通过java代码访问guvnor吗?

The mortgage-example already has some example code. 抵押示例已经有一些示例代码。 And the Drools Expert manual probably explains it in detail. Drools Expert手册可能会对此进行详细说明。 Here's the code: 这是代码:

private static KnowledgeBase readKnowledgeBase() throws Exception {
    KnowledgeAgent kagent = KnowledgeAgentFactory
            .newKnowledgeAgent( "MortgageAgent" );
    kagent.applyChangeSet( ResourceFactory
            .newClassPathResource( "changeset.xml" ) );
    KnowledgeBase kbase = kagent.getKnowledgeBase();
    kagent.dispose();
    return kbase;
}

<?xml version="1.0" encoding="UTF-8"?>
<change-set xmlns='http://drools.org/drools-5.0/change-set'
    xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
    xs:schemaLocation='http://drools.org/drools-5.0/change-set drools-change-set-5.0.xsd'>
  <add>
    <resource
  source='http://localhost:8080/guvnor-webapp/org.drools.guvnor.Guvnor/package/mortgages/LATEST'
  type='PKG' basicAuthentication='enabled' username='admin' password='admin' />

  </add>
</change-set>

We should document that in the Guvnor reference manual. 我们应该在Guvnor参考手册中对此进行记录。 Here's the issue . 这是问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM