gpt4 book ai didi

java代码访问drools guvnor

转载 作者:行者123 更新时间:2023-12-01 05:46:36 25 4
gpt4 key购买 nike

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

最佳答案

抵押贷款示例已经有一些示例代码。 Drools Expert手册大概有详细解释。代码如下:

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>

关于java代码访问drools guvnor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5777185/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com