use of org.kie.server.api.model.admin.ExecutionErrorInstanceList in project droolsjbpm-integration by kiegroup.
the class UserTaskAdminServiceBase method getExecutionErrorsByTaskName.
public ExecutionErrorInstanceList getExecutionErrorsByTaskName(String containerId, String processId, String taskName, boolean includeAcknowledged, Integer page, Integer pageSize, String sort, boolean sortOrder) {
logger.debug("About to get execution errors for task name {} in process {} and container {}", taskName, processId, containerId);
List<ExecutionError> errors = null;
if (containerId != null && !containerId.isEmpty()) {
errors = userTaskAdminService.getErrorsByTaskName(containerId, processId, taskName, includeAcknowledged, buildQueryContext(page, pageSize, sort, sortOrder));
} else if (processId != null && !processId.isEmpty()) {
errors = userTaskAdminService.getErrorsByTaskName(processId, taskName, includeAcknowledged, buildQueryContext(page, pageSize, sort, sortOrder));
} else if (taskName != null && !taskName.isEmpty()) {
errors = userTaskAdminService.getErrorsByTaskName(taskName, includeAcknowledged, buildQueryContext(page, pageSize, sort, sortOrder));
} else {
errors = userTaskAdminService.getErrors(includeAcknowledged, buildQueryContext(page, pageSize, sort, sortOrder));
}
logger.debug("Found errors {}", errors);
ExecutionErrorInstanceList errorInstanceList = convertToErrorInstanceList(errors);
return errorInstanceList;
}
use of org.kie.server.api.model.admin.ExecutionErrorInstanceList in project droolsjbpm-integration by kiegroup.
the class UserTaskAdminServiceBase method getExecutionErrorsByTaskId.
public ExecutionErrorInstanceList getExecutionErrorsByTaskId(String containerId, Number taskId, boolean includeAcknowledged, Integer page, Integer pageSize, String sort, boolean sortOrder) {
logger.debug("About to get execution errors for task id {}", taskId);
List<ExecutionError> errors = userTaskAdminService.getErrorsByTaskId(taskId.longValue(), includeAcknowledged, buildQueryContext(page, pageSize, sort, sortOrder));
logger.debug("Found errors {}", errors);
ExecutionErrorInstanceList errorInstanceList = convertToErrorInstanceList(errors);
return errorInstanceList;
}
use of org.kie.server.api.model.admin.ExecutionErrorInstanceList in project droolsjbpm-integration by kiegroup.
the class ProcessAdminServicesClientImpl method getErrors.
@Override
public List<ExecutionErrorInstance> getErrors(String containerId, boolean includeAcknowledged, Integer page, Integer pageSize) {
ExecutionErrorInstanceList result = null;
if (config.isRest()) {
Map<String, Object> valuesMap = new HashMap<String, Object>();
valuesMap.put(CONTAINER_ID, containerId);
String queryString = "?includeAck=" + includeAcknowledged;
queryString = getPagingQueryString(queryString, page, pageSize);
result = makeHttpGetRequestAndCreateCustomResponse(build(loadBalancer.getUrl(), ADMIN_PROCESS_URI + "/" + ERRORS_GET_URI + queryString, valuesMap), ExecutionErrorInstanceList.class);
} else {
CommandScript script = new CommandScript(Collections.singletonList((KieServerCommand) new DescriptorCommand("ProcessAdminService", "getExecutionErrors", new Object[] { containerId, includeAcknowledged, page, pageSize, "", true })));
ServiceResponse<ExecutionErrorInstanceList> response = (ServiceResponse<ExecutionErrorInstanceList>) executeJmsCommand(script, DescriptorCommand.class.getName(), "BPM").getResponses().get(0);
throwExceptionOnFailure(response);
if (shouldReturnWithNullResponse(response)) {
return null;
}
result = response.getResult();
}
if (result != null && result.getItems() != null) {
return result.getItems();
}
return Collections.emptyList();
}
use of org.kie.server.api.model.admin.ExecutionErrorInstanceList in project droolsjbpm-integration by kiegroup.
the class UserTaskAdminServicesClientImpl method getTaskErrors.
@Override
public List<ExecutionErrorInstance> getTaskErrors(String containerId, boolean includeAcknowledged, Integer page, Integer pageSize) {
ExecutionErrorInstanceList result = null;
if (config.isRest()) {
Map<String, Object> valuesMap = new HashMap<String, Object>();
valuesMap.put(CONTAINER_ID, containerId);
String queryString = "?includeAck=" + includeAcknowledged;
queryString = getPagingQueryString(queryString, page, pageSize);
result = makeHttpGetRequestAndCreateCustomResponse(build(loadBalancer.getUrl(), ADMIN_TASK_URI + "/" + ERRORS_GET_URI, valuesMap) + queryString, ExecutionErrorInstanceList.class);
} else {
CommandScript script = new CommandScript(Collections.singletonList((KieServerCommand) new DescriptorCommand("UserTaskAdminService", "getExecutionErrorsByTaskName", new Object[] { containerId, "", "", includeAcknowledged, page, pageSize, "", true })));
ServiceResponse<ExecutionErrorInstanceList> response = (ServiceResponse<ExecutionErrorInstanceList>) executeJmsCommand(script, DescriptorCommand.class.getName(), "BPM").getResponses().get(0);
throwExceptionOnFailure(response);
if (shouldReturnWithNullResponse(response)) {
return null;
}
result = response.getResult();
}
if (result != null && result.getItems() != null) {
return result.getItems();
}
return Collections.emptyList();
}
Aggregations