}
private WorkflowInstanceData createWorkflowInstanceData(
WorkflowExecution execution) {
WorkflowInstance workflowInstance = new WorkflowInstance(execution.getExperimentId(),execution.getTopic());
WorkflowInstanceData workflowInstanceData = new WorkflowInstanceData(workflowInstance, new WorkflowInstanceName(workflowInstance, execution.getWorkflowInstanceName()),new WorkflowInstanceUser(workflowInstance,execution.getUser()), new WorkflowInstanceStatus(workflowInstance,execution.getExecutionStatus().getExecutionStatus(),execution.getExecutionStatus().getStatusUpdateTime()), new WorkflowInstanceMetadata(workflowInstance,execution.getMetadata()), null);
Map<WorkflowInstanceNode, List<WorkflowInstanceNodePortData>> groupNodePortInputData = groupNodePortData(execution.getServiceInput());
Map<WorkflowInstanceNode, List<WorkflowInstanceNodePortData>> groupNodePortOutputData = groupNodePortData(execution.getServiceOutput());
for (WorkflowInstanceNode instanceNode : groupNodePortInputData.keySet()) {
workflowInstanceData.addNodeData(new WorkflowInstanceNodeData(instanceNode, groupNodePortInputData.get(instanceNode), null));
}
for (WorkflowInstanceNode instanceNode : groupNodePortOutputData.keySet()) {
WorkflowInstanceNodeData nodeData = workflowInstanceData.getNodeData(instanceNode.getNodeId());
if (nodeData==null){
workflowInstanceData.addNodeData(new WorkflowInstanceNodeData(instanceNode, null,groupNodePortOutputData.get(instanceNode)));
}else{
nodeData.setOutputData(groupNodePortOutputData.get(instanceNode));
}
}
return workflowInstanceData;