我正在使用 Kie Execution Server 6.2 final,我在服务器上部署了一个简单的规则文件,我正在通过 rest api 访问它。当我尝试执行规则时,一切都很顺利,但我没有在响应中得到新插入的事实。
这是我的drl文件
rule "Odd Rule"
dialect "mvel"
when
testRecord : TestRecord((integerValue & 1) == 1 && integerValue != 0 , testId: testRecordId , intValue :integerValue )
then
System.out.println( "Odd Rule- Test ID "+ testId );
TestResult $testResult = new TestResult();
$testResult.setTestrecordId(testId);
$testResult.setDescription("Odd Rule");
$testResult.setValueInteger(intValue * (-10));
insert($testResult);
end
并在服务器上发布请求
<batch-execution>
<insert out-identifier="TestReord">
<com.drools.poc.TestRecord>
<integerValue>10</integerValue>
<testRecordId>10</testRecordId>
</com.drools.poc.TestRecord>
</insert>
来自服务器的响应
<response type="SUCCESS" msg="Container Container1 successfully called.">
<results><execution-results>
<result identifier="TestReord">
<com.drools.poc.TestRecord>
<integerValue>10</integerValue>
<testRecordId>10</testRecordId>
</com.drools.poc.TestRecord>
</result>
<fact-handle identifier="TestReord" external form="0:29:1697585638:1697585638:29:DEFAULT:NON_TRAIT"/>
</execution-results></results>
</response>