问题
I am using Kie Execution Server 6.2 final and I have a simple rule file deployed on the server and I am accessing it through rest api. When I try to execute the rules, everything goes well, but I do not get newly inserted fact in the response.
Here is my drl file
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
and post request on server
<batch-execution>
<insert out-identifier="TestReord">
<com.drools.poc.TestRecord>
<integerValue>10</integerValue>
<testRecordId>10</testRecordId>
</com.drools.poc.TestRecord>
</insert>
response from server
<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>
来源:https://stackoverflow.com/questions/31495266/drools-how-to-retrieve-the-fact-in-response-from-kie-execution-server