use of org.kie.internal.runtime.error.ExecutionError in project jbpm by kiegroup.
the class DefaultExecutionErrorStorage method acknowledge.
@Override
public void acknowledge(final String user, final String... errorIds) {
if (!isActive()) {
return;
}
call((EntityManager em) -> {
for (String errorId : errorIds) {
ExecutionError error = (ExecutionError) em.createQuery("from ExecutionErrorInfo where errorId =:errorId").setParameter("errorId", errorId).getSingleResult();
error.setAcknowledged(true);
error.setAcknowledgedBy(user);
error.setAcknowledgedAt(new Date());
em.merge(error);
}
return null;
});
}
use of org.kie.internal.runtime.error.ExecutionError in project jbpm by kiegroup.
the class ExecutionErrorHandlerImpl method handle.
@Override
public void handle(Throwable cause) {
ExecutionErrorContext errorContext = new ExecutionErrorContext(cause, lastExecutedNode, lastExecutedTask, firstExecutedNode);
for (ExecutionErrorFilter filter : filters) {
if (filter.accept(errorContext)) {
ExecutionError error = filter.filter(errorContext);
logger.debug("Filter {} returned {} for {}", filter, error, cause);
if (error != null) {
try {
storage.store(error);
logger.debug("Error event {} stored successfully in {}", error, storage);
} catch (Throwable e) {
logger.warn("Could not persist execution error {} due to {}", error, e.getMessage());
logger.debug("Stack trace ", e);
}
} else {
logger.debug("Filter {} accepted error {} but didn't produce results (error should be ignored)", filter, cause);
}
return;
}
}
// in case it ended up here - meaning not filters dealt with it, simply log the error
logger.error("Unexpected error during processing ", cause);
}
Aggregations