Search in sources :

Example 1 with ExecutionErrorNotFoundException

use of org.jbpm.services.api.admin.ExecutionErrorNotFoundException in project jbpm by kiegroup.

the class UserTaskAdminServiceImpl method acknowledgeError.

@Override
public void acknowledgeError(String... errorId) throws ExecutionErrorNotFoundException {
    for (String error : errorId) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("errorId", error);
        params.put("ack", new Short("0"));
        List<ExecutionError> execErrors = commandService.execute(new QueryNameCommand<List<ExecutionError>>("getErrorById", params));
        if (execErrors.isEmpty()) {
            throw new ExecutionErrorNotFoundException("No execution error found for id " + errorId);
        }
        ExecutionError errorInstance = execErrors.get(0);
        RuntimeManager runtimeManager = RuntimeManagerRegistry.get().getManager(errorInstance.getDeploymentId());
        if (runtimeManager != null) {
            ((AbstractRuntimeManager) runtimeManager).getExecutionErrorManager().getStorage().acknowledge(identityProvider.getName(), errorInstance.getErrorId());
        }
    }
}
Also used : ExecutionError(org.kie.internal.runtime.error.ExecutionError) HashMap(java.util.HashMap) ExecutionErrorNotFoundException(org.jbpm.services.api.admin.ExecutionErrorNotFoundException) AbstractRuntimeManager(org.jbpm.runtime.manager.impl.AbstractRuntimeManager) RuntimeManager(org.kie.api.runtime.manager.RuntimeManager) AbstractRuntimeManager(org.jbpm.runtime.manager.impl.AbstractRuntimeManager) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with ExecutionErrorNotFoundException

use of org.jbpm.services.api.admin.ExecutionErrorNotFoundException in project jbpm by kiegroup.

the class ProcessInstanceAdminServiceImpl method acknowledgeError.

@Override
public void acknowledgeError(String... errorId) throws ExecutionErrorNotFoundException {
    for (String error : errorId) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("errorId", error);
        params.put("ack", new Short("0"));
        List<ExecutionError> execErrors = commandService.execute(new QueryNameCommand<List<ExecutionError>>("getErrorById", params));
        if (execErrors.isEmpty()) {
            throw new ExecutionErrorNotFoundException("No execution error found for id " + errorId);
        }
        ExecutionError errorInstance = execErrors.get(0);
        RuntimeManager runtimeManager = RuntimeManagerRegistry.get().getManager(errorInstance.getDeploymentId());
        if (runtimeManager != null) {
            ((AbstractRuntimeManager) runtimeManager).getExecutionErrorManager().getStorage().acknowledge(identityProvider.getName(), errorInstance.getErrorId());
        }
    }
}
Also used : ExecutionError(org.kie.internal.runtime.error.ExecutionError) HashMap(java.util.HashMap) ExecutionErrorNotFoundException(org.jbpm.services.api.admin.ExecutionErrorNotFoundException) AbstractRuntimeManager(org.jbpm.runtime.manager.impl.AbstractRuntimeManager) RuntimeManager(org.kie.api.runtime.manager.RuntimeManager) AbstractRuntimeManager(org.jbpm.runtime.manager.impl.AbstractRuntimeManager) ArrayList(java.util.ArrayList) List(java.util.List)

Example 3 with ExecutionErrorNotFoundException

use of org.jbpm.services.api.admin.ExecutionErrorNotFoundException in project jbpm by kiegroup.

the class ProcessInstanceAdminServiceImpl method getError.

@Override
public ExecutionError getError(String errorId) throws ExecutionErrorNotFoundException {
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("errorId", errorId);
    List<ExecutionError> execErrors = commandService.execute(new QueryNameCommand<List<ExecutionError>>("getErrorByIdSkipAckCheck", params));
    if (execErrors.isEmpty()) {
        throw new ExecutionErrorNotFoundException("No execution error found for id " + errorId);
    }
    ExecutionError error = execErrors.get(0);
    return error;
}
Also used : ExecutionError(org.kie.internal.runtime.error.ExecutionError) HashMap(java.util.HashMap) ExecutionErrorNotFoundException(org.jbpm.services.api.admin.ExecutionErrorNotFoundException) ArrayList(java.util.ArrayList) List(java.util.List)

Example 4 with ExecutionErrorNotFoundException

use of org.jbpm.services.api.admin.ExecutionErrorNotFoundException in project jbpm by kiegroup.

the class UserTaskAdminServiceImpl method getError.

@Override
public ExecutionError getError(String errorId) throws ExecutionErrorNotFoundException {
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("errorId", errorId);
    List<ExecutionError> execErrors = commandService.execute(new QueryNameCommand<List<ExecutionError>>("getErrorByIdSkipAckCheck", params));
    if (execErrors.isEmpty()) {
        throw new ExecutionErrorNotFoundException("No execution error found for id " + errorId);
    }
    ExecutionError error = execErrors.get(0);
    return error;
}
Also used : ExecutionError(org.kie.internal.runtime.error.ExecutionError) HashMap(java.util.HashMap) ExecutionErrorNotFoundException(org.jbpm.services.api.admin.ExecutionErrorNotFoundException) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 List (java.util.List)4 ExecutionErrorNotFoundException (org.jbpm.services.api.admin.ExecutionErrorNotFoundException)4 ExecutionError (org.kie.internal.runtime.error.ExecutionError)4 AbstractRuntimeManager (org.jbpm.runtime.manager.impl.AbstractRuntimeManager)2 RuntimeManager (org.kie.api.runtime.manager.RuntimeManager)2