drools - Kie Workbench Execute Rules -
may question has been asked number of times not figure out actual solution going through them. have decision table in kieworkbench takes input 1 fact , sets fact. trying call rules invoking endpoint: http://localhost:8085/kie-server-6.4.0.final-ee7/services/rest/server/containers/instances/pocresult
in header, have set 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>
my decision table below:
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" ) result rs = new result(); rs.setresultstartdate( "*today" ); rs.setresultenddate( "*yearend" ); rs.setresultcontentstartdate( "*today" ); rs.setresultcontentenddate( "*yearend" ); insert( rs ); end
how can result object response? here response:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <response type="success" msg="container pocresult 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>
i want result object dates set.
what response get?
i firstly try place fire-all-rules tag after return object. otherwise, try:
<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> <insert out-identifier="result" return-object="true" entry-point="default"> <demo.pocfindresult.result/> </insert> <fire-all-rules/> </batch-execution>
Comments
Post a Comment