if (LOG.isDebugEnabled()) {
LOG.debug("Received call to complete create resource: " + response);
}
// Load the persisted history entry
CreateResourceHistory history = entityManager.find(CreateResourceHistory.class, response.getRequestId());
// There is some inconsistency if we're completing a request that was not in the database
if (history == null) {
LOG.error("Attempting to complete a request that was not found in the database: " + response.getRequestId());
return;
}
// Update the history entry
history.setNewResourceKey(response.getResourceKey());
history.setErrorMessage(response.getErrorMessage());
history.setStatus(response.getStatus());
// The configuration may now have error messages in it, so merge with the persisted one
if (response.getResourceConfiguration() != null) {
entityManager.merge(response.getResourceConfiguration());
}