我正在使用 kie-server 7.0 和 kie-java-client 7.0。我在工作台上写了一个简单的规则:-
rule "Hello World"
when
a:CartDetails(minPurchaseAmt==10000)
then
a.setMinPurchaseAmt(20.0f);
System.out.println( "Test rule executed success");
end
这是我的客户代码:-
Command<?> insert = commandsFactory.newInsert(fact, "CartDetails",true,"DEFAULT");
Command<?> fireAllRules = commandsFactory.newFireAllRules();
Command<?> factObjects = commandsFactory.newGetObjects();
Command<?> batchCommand = commandsFactory.newBatchExecution(Arrays.asList(insert,fireAllRules,factObjects));
ServiceResponse<ExecutionResults> executeResponse = rulesClient.executeCommandsWithResults("couponengine_1.0", batchCommand);
我得到“成功”作为响应,但没有得到更新的对象。(因为我在规则的“那么”部分调用 setMinPurchaseAmt())
请告诉您是否需要更多输入。