Search in sources :

Example 11 with ExecutionErrorInstanceList

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;
}
Also used : ExecutionError(org.kie.internal.runtime.error.ExecutionError) ExecutionErrorInstanceList(org.kie.server.api.model.admin.ExecutionErrorInstanceList)

Example 12 with ExecutionErrorInstanceList

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;
}
Also used : ExecutionError(org.kie.internal.runtime.error.ExecutionError) ExecutionErrorInstanceList(org.kie.server.api.model.admin.ExecutionErrorInstanceList)

Example 13 with ExecutionErrorInstanceList

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();
}
Also used : DescriptorCommand(org.kie.server.api.commands.DescriptorCommand) ServiceResponse(org.kie.server.api.model.ServiceResponse) KieServerCommand(org.kie.server.api.model.KieServerCommand) ExecutionErrorInstanceList(org.kie.server.api.model.admin.ExecutionErrorInstanceList) HashMap(java.util.HashMap) CommandScript(org.kie.server.api.commands.CommandScript)

Example 14 with ExecutionErrorInstanceList

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();
}
Also used : DescriptorCommand(org.kie.server.api.commands.DescriptorCommand) ServiceResponse(org.kie.server.api.model.ServiceResponse) KieServerCommand(org.kie.server.api.model.KieServerCommand) ExecutionErrorInstanceList(org.kie.server.api.model.admin.ExecutionErrorInstanceList) HashMap(java.util.HashMap) CommandScript(org.kie.server.api.commands.CommandScript)

Aggregations

ExecutionErrorInstanceList (org.kie.server.api.model.admin.ExecutionErrorInstanceList)14 HashMap (java.util.HashMap)5 ExecutionError (org.kie.internal.runtime.error.ExecutionError)5 CommandScript (org.kie.server.api.commands.CommandScript)5 DescriptorCommand (org.kie.server.api.commands.DescriptorCommand)5 KieServerCommand (org.kie.server.api.model.KieServerCommand)5 ServiceResponse (org.kie.server.api.model.ServiceResponse)5 ApiOperation (io.swagger.annotations.ApiOperation)4 ApiResponses (io.swagger.annotations.ApiResponses)4 GET (javax.ws.rs.GET)4 Path (javax.ws.rs.Path)4 Produces (javax.ws.rs.Produces)4 Variant (javax.ws.rs.core.Variant)4 DeploymentNotFoundException (org.jbpm.services.api.DeploymentNotFoundException)4 ProcessInstanceNotFoundException (org.jbpm.services.api.ProcessInstanceNotFoundException)4 ExecutionErrorNotFoundException (org.jbpm.services.api.admin.ExecutionErrorNotFoundException)4 Header (org.kie.server.remote.rest.common.Header)4 RestUtils.buildConversationIdHeader (org.kie.server.remote.rest.common.util.RestUtils.buildConversationIdHeader)4 RestUtils.createCorrectVariant (org.kie.server.remote.rest.common.util.RestUtils.createCorrectVariant)4 RestUtils.getVariant (org.kie.server.remote.rest.common.util.RestUtils.getVariant)4