JSONRest { public String executeCmds(String containerId, Object insertObject){ RuleServicesClient ruleServicesClient = kieServicesClient.getServicesClient(RuleServicesClient.class); KieCommands commands = KieServices.Factory.get().getCommands(); Command<?> insertCmd = commands.newInsert(insertObject); Command<?> fireAllRules = commands.newFireAllRules(); Command<?> batchCmds = commands.newBatchExecution(Arrays.asList(insertCmd, fireAllRules)); ServiceResponse<String> response = ruleServicesClient.executeCommands(containerId, batchCmds); if(response.getType() == ServiceResponse.ResponseType.SUCCESS){ return response.getResult(); } return response.getMsg(); } JSONRest(KieServerCfg serverCfg); void initialize(KieServerCfg serverCfg); String executeCmds(String containerId, Object insertObject);  }
@Test public void jsonTest() throws Exception { KieServerCfg cfg = new KieServerCfg(); cfg.setUrl("http: cfg.setUser("kieserver"); cfg.setPassword("kieserver"); MyBean bean = new MyBean(); bean.setName("jackzeng"); bean.setAge(1); JSONRest rest = new JSONRest(cfg); System.out.println(rest.executeCmds("client-test1.1",bean)); }