@Override
public void addProblemFactChanges(String containerId,
String solverId,
List<ProblemFactChange> problemFactChanges) {
checkMandatoryParameter("containerId",
containerId);
checkMandatoryParameter("solverId",
solverId);
checkMandatoryParameter("problemFactChange",
problemFactChanges);
if (config.isRest()) {
String uri = getURI(containerId,
solverId) + "/" + RestURI.SOLVER_PROBLEM_FACT_CHANGES;
makeHttpPostRequestAndCreateCustomResponse(uri,
problemFactChanges,
ServiceResponse.class,
getHeaders(problemFactChanges));
} else {
CommandScript script = new CommandScript(Collections.singletonList(new AddProblemFactChangesCommand(containerId,
solverId,
problemFactChanges)));
ServiceResponse<Void> response = (ServiceResponse<Void>) executeJmsCommand(script,
AddProblemFactChangeCommand.class.getName(),
KieServerConstants.CAPABILITY_BRP,
containerId).getResponses().get(0);
throwExceptionOnFailure(response);
}
}