Uploaded image for project: 'Red Hat Process Automation Manager'
  1. Red Hat Process Automation Manager
  2. RHPAM-2107

Not able to execute score card through kie-server Remote java API's.

    Details

    • Target Release:
    • Fix Build:
      CR1
    • Steps to Reproduce:
      Hide

      Import attached git project into business-central, build project and try to execute score card using code shown above.

      Show
      Import attached git project into business-central, build project and try to execute score card using code shown above.
    • Story Points:
      5
    • Sprint:
      2019 Week 17-19, 2019 Week 20-22

      Description

      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);
      		 */
      	}
      
      

        Gliffy Diagrams

          Attachments

          1. SampleScore_c.sxls.properties
            0.2 kB
          2. SampleScore.tar
            180 kB
          3. StackTrace
            12 kB

            Activity

              People

              • Assignee:
                lleveric Lance Leverich
                Reporter:
                abhumbe Abhijit Humbe
                Tester:
                Jiri Petrlik
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: