-
Bug
-
Resolution: Done
-
Major
-
7.3.0.GA
Customer is using xls base score card, and they are not able to execute rules through kie-server remote java API's. It fails with exception. In console I can see 'ERROR-2' is logged after execution of "resultHolder.getResultCode()" I tried to execute score card with below code:
public static void scoreCardExecution() { PMMLRequestData request = new PMMLRequestData(); request.addRequestParam("age", (int) 5); request.addRequestParam("occupation", "TEACHER"); request.addRequestParam("residenceState", "TN"); request.addRequestParam("validLicense", false); KieCommands kieCommands = KieServices.Factory.get().getCommands(); CommandFactoryServiceImpl command = (CommandFactoryServiceImpl) kieCommands; ApplyPmmlModelCommand applyPmmlModelCommand = (ApplyPmmlModelCommand) command.newApplyPmmlModel(request); RuleServicesClient ruleServicesClient = kieServicesClient.getServicesClient(RuleServicesClient.class); ServiceResponse<org.kie.api.runtime.ExecutionResults> results = ruleServicesClient .executeCommandsWithResults(ContainerId, applyPmmlModelCommand); PMML4Result resultHolder = (PMML4Result) results.getResult().getValue("results"); // System.out.println(resultHolder); System.out.println(resultHolder.getResultCode()); /* * Double targetValue = resultHolder.getResultValue("totalScore", * "value", Double.class).orElse(null); System.out.println(targetValue); */ }