I have created a rule engine with KIE Work Bench and KIE server as the deployment interface. I was able to publish the rule in the server.
at org.kie.server.client.impl.KieServicesClientImpl.createExceptionForUnexpectedResponseCode(KieServicesClientImpl.java:416)
at org.kie.server.client.impl.KieServicesClientImpl.makeHttpPostRequestAndCreateServiceResponse(KieServicesClientImpl.java:213)
at org.kie.server.client.impl.KieServicesClientImpl.executeCommands(KieServicesClientImpl.java:133)
at com.ust.digital.common.util.TestUtlity.main(TestUtlity.java:89)
CategoryObj cat = new CategoryObj();
Map count = new HashMap<>();
Map sorted = new HashMap<>();
sorted.put("A", "NEGATIVE");
sorted.put("A", "NEGATIVE");
sorted.put("B", "NEGATIVE");
sorted.put("B", "POSITIVE");
sorted.put("B", "POSITIVE");
count.put("A", 2);
count.put("B", 3);
cat.setCountMap(count);
cat.setSortedMap(sorted);
InsertObjectCommand insertObjectCommand = new InsertObjectCommand(cat, "f1");
FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand("myFireCommand");
List<GenericCommand<?>> commands = new ArrayList<GenericCommand<?>>();
commands.add(insertObjectCommand);
commands.add(fireAllRulesCommand);
BatchExecutionCommand command = new BatchExecutionCommandImpl(commands);
String xStreamXml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);
KieServicesConfiguration config = KieServicesFactory.
"kieserver",
"kieserver1!");
KieServicesClient client = KieServicesFactory.newKieServicesClient(config);
// the request "xStreamXml" we generated in previous step
// "ListenerReproducer" is the name of the Container
ServiceResponse<String> response = client.executeCommands("Myrules", xStreamXml);
System.out.println(response.getResult());
Please let me know the you need any further information.