I'm attempting to execute a rule that was authored using Drools Workbench (business-central-7.17.0.Final-wildfly14.war) via KIE execution server (kie-server-7.17.0.Final-ee7.war), I don't get the expected response when I execute the rule using Postman, REST client.
I've tried setting request headers "X-KIE-ContentType XSTREAM
", setting payload tag <insert out-identifier="Employee" return-object="true" entry-point="DEFAULT">
where out-identifier="Employee"
is the fact.
Request Payload
<batch-execution lookup="TestBaseSession">
<insert out-identifier="Employee" return-object="true" entry-point="DEFAULT">
<com.test.Employee>
<iEmpId>27</iEmpId>
<strName></strName>
</com.test.Employee>
</insert>
<fire-all-rules/>
</batch-execution>
Rule file
package com.test;
import com.test.Employee;
//This is the first rule
rule "001"
when
emp : Employee(iEmpId==27)
then
emp.setStrName("FooBar");
insert(emp);
//System.out.println("DDDDD");
end
I expect the output to be something like below (or similar to it),
<response type="SUCCESS" msg="Container Test_1.0.0 successfully called.">
<result class="execution-results">
<result identifier="Employee">
<com.test.Employee>
<iEmpId>27</iEmpId>
<strName>FooBar</strName>
</com.test.Employee>
</result>
<fact-handle identifier="Employee" external-form="0:1:850421248:850421248:1:DEFAULT:NON_TRAIT:com.test.Employee"/>
</result>
</response>
But I didn't get the expected, nor the System.out message isn't printed in Wildfly console, which suggests that the rule isn't executed? any suggestions would be really helpful.