我一直致力于一个drools项目,我们最近开始使用kie-maven-plugin将我们的电子表格构建到kjars中。现在,为了测试kjar构建,我有1个电子表格和1个查询。我遇到的问题是找不到查询。我不确定是否找到了电子表格规则,但我正在开会。
很抱歉很长的帖子,但我真的需要帮助。完整信息如下......
我的kmodule.xml:
<kbase name="com.foo.ratings.decisionTables.flex">
<ksession name="flex"/>
</kbase>
我的查询:
package com.foo.ratings.decisionTables.flex;
import com.foo.ratings.tangerinegin.facts.*;
query "getFlexCode"
$flexGroupCd: FlexGroupCdFact()
end
错误:
2017-11-02 11:01:35.727 ERROR 34585 --- [nio-8080-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: Query 'getFlexCode' does not exist] with root cause
java.lang.RuntimeException: Query 'getFlexCode' does not exist
at org.drools.core.impl.StatefulKnowledgeSessionImpl$ExecuteQuery.execute(StatefulKnowledgeSessionImpl.java:907) ~[drools-core-7.1.0.Final.jar!/:7.1.0.Final]
at org.drools.core.phreak.SynchronizedPropagationList$1.execute(SynchronizedPropagationList.java:53) ~[drools-core-7.1.0.Final.jar!/:7.1.0.Final]
我们查看了kjar,我们看到了kmodule.xml以及kbase.cache。这是扩展的jar:
drwxr-xr-x 7 localadmin staff 238 Nov 2 11:17 META-INF
-rw-r--r-- 1 localadmin staff 0 Nov 2 10:54 application.properties
drwxr-xr-x 3 localadmin staff 102 Nov 2 10:54 com
com扩展到com / foo / ratings / decisionTables / flex并包含我的电子表格和我的查询drl文件。
这是扩展的META-INF:
-rw-r--r-- 1 localadmin staff 100 Nov 2 10:56 MANIFEST.MF
drwxr-xr-x 3 localadmin staff 102 Nov 2 10:56 com
-rw-r--r-- 1 localadmin staff 752813 Nov 2 10:56 kmodule.info
-rw-r--r-- 1 localadmin staff 209 Nov 2 10:54 kmodule.xml
drwxr-xr-x 4 localadmin staff 136 Nov 2 10:54 maven
META-INF / com扩展到com / foo / ratings / decisionTables / flex并包含我的kbase.cache。
我的pom:
<groupId>com.foo.ratings.tangerineGin</groupId>
<artifactId>MyFlex</artifactId>
<version>1.0.2</version>
<packaging>kjar</packaging>
<build>
<plugins>
<plugin>
<groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<version>7.1.0.Final</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
我的kmodule.info:
<rulesByPackage>
<entry>
<string>com.foo.ratings.decisionTables.flex</string>
<set>
<string>getFlexCode</string>
</set>
</entry>
<entry>
<string>com.foo.decisionTable.calculateFlexGroup_CO</string>
<set>
<string>calculate_flex_959</string>
我显然错过了一些简单的事情,但我现在正在转动我的车轮。非常感谢任何帮助。
由于
编辑:已添加kmodule
Found kmodule: jar:file:/Users/localadmin/workspace/TangerineGin/TangerineGin-server/build/libs/tangerine-gin-server-1.0.jar!/BOOT-INF/lib/TangerineGin-flex-1.0.6.jar!/META-INF/kmodule.xml
Unable to find pom.properties in /Users/localadmin/workspace/TangerineGin/TangerineGin-server/build/libs/tangerine-gin-server-1.0.jar
Unable to load pom.properties from/Users/localadmin/workspace/TangerineGin/TangerineGin-server/build/libs/tangerine-gin-server-1.0.jar
Cannot find maven pom properties for this project. Using the container's default ReleaseId
KieModule was added: ZipKieModule[releaseId=org.default:artifact:1.0.0-SNAPSHOT,file=/Users/localadmin/workspace/TangerineGin/TangerineGin-server/build/libs/tangerine-gin-server-1.0.jar]