public void save() throws RegistryException{
EntityManager em = null;
try {
em = ResourceUtils.getEntityManager();
em.getTransaction().begin();
ErrorDetail errorDetail = new ErrorDetail();
errorDetail.setErrorID(errorId);
Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
errorDetail.setExperiment(experiment);
errorDetail.setExpId(experimentResource.getExpID());
if (taskDetailResource != null) {
TaskDetail taskDetail = em.find(TaskDetail.class, taskDetailResource.getTaskId());
errorDetail.setTask(taskDetail);
errorDetail.setTaskId(taskDetail.getTaskId());
}
if (nodeDetail != null) {
WorkflowNodeDetail workflowNodeDetail = em.find(WorkflowNodeDetail.class, nodeDetail.getNodeInstanceId());
errorDetail.setNodeDetails(workflowNodeDetail);
errorDetail.setNodeId(workflowNodeDetail.getNodeId());
}
errorDetail.setCreationTime(creationTime);
errorDetail.setActualErrorMsg(actualErrorMsg.toCharArray());
errorDetail.setUserFriendlyErrorMsg(userFriendlyErrorMsg);
errorDetail.setTransientPersistent(transientPersistent);
errorDetail.setErrorCategory(errorCategory);
errorDetail.setCorrectiveAction(correctiveAction);
errorDetail.setActionableGroup(actionableGroup);
errorDetail.setJobId(jobId);
em.persist(errorDetail);
errorId = errorDetail.getErrorID();
em.getTransaction().commit();
em.close();
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new RegistryException(e);