use of org.kie.server.api.model.admin.ExecutionErrorInstanceList in project droolsjbpm-integration by kiegroup.
the class UserTaskAdminServicesClientImpl method getErrorsByTaskId.
@Override
public List<ExecutionErrorInstance> getErrorsByTaskId(String containerId, Long taskId, 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);
valuesMap.put(TASK_INSTANCE_ID, taskId);
String queryString = "?includeAck=" + includeAcknowledged;
queryString = getPagingQueryString(queryString, page, pageSize);
result = makeHttpGetRequestAndCreateCustomResponse(build(loadBalancer.getUrl(), ADMIN_TASK_URI + "/" + ERRORS_BY_TASK_ID_GET_URI, valuesMap) + queryString, ExecutionErrorInstanceList.class);
} else {
CommandScript script = new CommandScript(Collections.singletonList((KieServerCommand) new DescriptorCommand("UserTaskAdminService", "getExecutionErrorsByTaskId", new Object[] { containerId, taskId, 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 getErrorsByTaskInfo.
@Override
public List<ExecutionErrorInstance> getErrorsByTaskInfo(String containerId, Long processId, String taskName, 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 + "&name=" + taskName + "&process=" + processId;
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, processId, taskName, 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 ConvertUtils method convertToErrorInstanceList.
public static ExecutionErrorInstanceList convertToErrorInstanceList(List<ExecutionError> executionErrors) {
if (executionErrors == null) {
return new ExecutionErrorInstanceList(new ExecutionErrorInstance[0]);
}
List<ExecutionErrorInstance> executionErrorInstances = new ArrayList<ExecutionErrorInstance>(executionErrors.size());
for (ExecutionError error : executionErrors) {
ExecutionErrorInstance errorInstance = convertToErrorInstance(error);
executionErrorInstances.add(errorInstance);
}
return new ExecutionErrorInstanceList(executionErrorInstances);
}
use of org.kie.server.api.model.admin.ExecutionErrorInstanceList in project droolsjbpm-integration by kiegroup.
the class ProcessAdminServiceBase method getExecutionErrorsByProcessInstance.
public ExecutionErrorInstanceList getExecutionErrorsByProcessInstance(String containerId, Number processInstanceId, String nodeName, boolean includeAcknowledged, Integer page, Integer pageSize, String sort, boolean sortOrder) {
logger.debug("About to get execution errors for process instance id {} and node {}", processInstanceId, nodeName);
List<ExecutionError> errors = null;
if (nodeName == null || nodeName.isEmpty()) {
errors = processInstanceAdminService.getErrorsByProcessInstanceId(processInstanceId.longValue(), includeAcknowledged, buildQueryContext(page, pageSize, sort, sortOrder));
;
} else {
errors = processInstanceAdminService.getErrorsByProcessInstanceId(processInstanceId.longValue(), nodeName, 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 ProcessAdminServiceBase method getExecutionErrors.
public ExecutionErrorInstanceList getExecutionErrors(String containerId, boolean includeAcknowledged, Integer page, Integer pageSize, String sort, boolean sortOrder) {
logger.debug("About to get execution errors");
List<ExecutionError> errors = processInstanceAdminService.getErrorsByDeploymentId(containerId, includeAcknowledged, buildQueryContext(page, pageSize, sort, sortOrder));
logger.debug("Found errors {}", errors);
ExecutionErrorInstanceList errorInstanceList = convertToErrorInstanceList(errors);
return errorInstanceList;
}
Aggregations