可能这个问题已经被问过很多次了,但我无法通过它们找出实际的解决方案。我在 KIEWorkbench 中有一个决策表,它从一个事实中获取输入并将其设置为另一个事实。我试图通过调用端点来调用规则:http://localhost:8085/kie-server-6.4.0.Final-ee7/services/rest/server/containers/instances/pocResult
在标题中,我将 Content-Type 设置为 application/xml。
<batch-execution lookup="ksession">
<insert out-identifier="Subject">
<demo.pocFindResult.Subject>
<bCode> ABC</bCode>
<bGCode>XY</bGCode>
<pCode>L0001</pcode>
<subjectType>CA</subjectType>
</demo.pocFindResult.Subject>
</insert>
<fire-all-rules />
<get-objects out-identifier="Result">
<demo.pocFindResult.result/>
</get-objects>
我的决策表如下:
package demo.pocFindResult;
//from row number: 1
rule "Row 1 findrules"
ruleflow-group "fire-rules"
dialect "java"
lock-on-active true
no-loop true
when
sub : Subject( bCode == "ABC" , bGCode == "XY" , subjectType == "CA" , pCode == "L0001" )
then
Result rs = new Result();
rs.setResultStartDate( "*TODAY" );
rs.setResultEndDate( "*YEAREND" );
rs.setResultContentStartDate( "*TODAY" );
rs.setResultContentEndDate( "*YEAREND" );
insert( rs );
end
如何获取 Result 对象作为响应?这是我的回应:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response type="SUCCESS" msg="Container pocResult successfully called.">
<execution-results>
<results>
<item key="Subject">
<value xsi:type="jaxbListWrapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<type>LIST</type>
</value>
</item>
</results>
<facts>
<item key="Subject"/>
</facts>
</execution-results>
</response>
我想要设置日期的结果对象。