use of org.kie.server.api.commands.CallContainerCommand in project droolsjbpm-integration by kiegroup.
the class RuleServicesClientImpl method executeCommandsWithResults.
@Override
public ServiceResponse<ExecutionResults> executeCommandsWithResults(String id, String payload) {
if (config.isRest()) {
return makeHttpPostRequestAndCreateServiceResponse(loadBalancer.getUrl() + "/containers/instances/" + id, payload, (Class) ExecutionResultImpl.class);
} else {
CommandScript script = new CommandScript(Collections.singletonList((KieServerCommand) new CallContainerCommand(id, payload)));
ServiceResponse response = executeJmsCommand(script, null, null, id).getResponses().get(0);
if (shouldReturnWithNullResponse(response)) {
return null;
}
if (response.getResult() instanceof String) {
response.setResult(deserialize((String) response.getResult(), (Class) ExecutionResultImpl.class));
}
return response;
}
}
Aggregations