}
private void fillWorkflowInstanceData (ExperimentData experimentData,
ResultSet rs,
List<WorkflowExecution> workflowInstances) throws SQLException, ExperimentLazyLoadedException, ParseException {
WorkflowExecutionDataImpl workflowInstanceData = (WorkflowExecutionDataImpl)experimentData.getWorkflowExecutionData(rs.getString(5));
if (workflowInstanceData == null){
WorkflowExecution workflowInstance = new WorkflowExecution(experimentData.getExperimentId(), rs.getString(5));
workflowInstance.setTemplateName(rs.getString(6));
workflowInstance.setExperimentId(rs.getString(1));
workflowInstance.setWorkflowExecutionId(rs.getString(5));
workflowInstances.add(workflowInstance);
Date lastUpdateDate = getTime(rs.getString(9));
String wdStatus = rs.getString(7);
WorkflowExecutionStatus workflowExecutionStatus = new WorkflowExecutionStatus(workflowInstance,
createExecutionStatus(wdStatus),lastUpdateDate);
workflowInstanceData = new WorkflowExecutionDataImpl(null,
workflowInstance, workflowExecutionStatus, null);
ExperimentDataImpl expData = (ExperimentDataImpl) experimentData;
workflowInstanceData.setExperimentData(expData);
// Set the last updated workflow's status and time as the experiment's status
if(expData.getExecutionStatus()!=null) {
if(expData.getExecutionStatus().getStatusUpdateTime().compareTo(workflowExecutionStatus.getStatusUpdateTime())<0) {
expData.setExecutionStatus(workflowExecutionStatus);
}
} else {
expData.setExecutionStatus(workflowExecutionStatus);
}
experimentData.getWorkflowExecutionDataList().add(workflowInstanceData);
}
WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(workflowInstanceData.getWorkflowExecution(), rs.getString(10));
NodeExecutionData workflowInstanceNodeData = new NodeExecutionData(workflowInstanceNode);
String inputData = getStringValue(11, rs);
String outputData = getStringValue(12, rs);
workflowInstanceNodeData.setInput(inputData);
workflowInstanceNodeData.setOutput(outputData);
workflowInstanceNodeData.setStatus(createExecutionStatus(rs.getString(16)), getTime(rs.getString(18)));
workflowInstanceNodeData.setType(WorkflowNodeType.getType(rs.getString(15)).getNodeType());
workflowInstanceData.getNodeDataList().add(workflowInstanceNodeData);
}