if(lastUpdateTime == null){
java.util.Date date= new java.util.Date();
lastUpdateTime = new Timestamp(date.getTime());
}
EntityManager em = ResourceUtils.getEntityManager();
Node_Data existingNodeData = em.find(Node_Data.class, new Node_DataPK(workflowDataResource.getWorkflowInstanceID(), nodeID, executionIndex));
em.close();
em = ResourceUtils.getEntityManager();
em.getTransaction().begin();
Node_Data nodeData = new Node_Data();
nodeData.setNode_id(nodeID);
Workflow_Data workflow_data = em.find(Workflow_Data.class, workflowDataResource.getWorkflowInstanceID());
nodeData.setWorkflow_Data(workflow_data);
byte[] inputsByte = null;
if (inputs!=null) {
inputsByte = inputs.getBytes();
nodeData.setInputs(inputsByte);
}
byte[] outputsByte = null;
if (outputs!=null) {
outputsByte = outputs.getBytes();
nodeData.setOutputs(outputsByte);
}
nodeData.setNode_type(nodeType);
nodeData.setLast_update_time(lastUpdateTime);
nodeData.setStart_time(startTime);
nodeData.setStatus(status);
nodeData.setExecution_index(executionIndex);
if(existingNodeData != null){
existingNodeData.setInputs(inputsByte);
existingNodeData.setOutputs(outputsByte);
existingNodeData.setLast_update_time(lastUpdateTime);
existingNodeData.setNode_type(nodeType);