private WorkflowHistory getSubflow( TaskHistory taskHistory, List<WorkflowHistory> workflowHistories) { String taskId = taskHistory.getTaskId(); for (WorkflowHistory workflowHistory : workflowHistories) { if (workflowHistory != null && workflowHistory.getSf_taskId().equals(taskId)) return workflowHistory; } return null; }
private Map getNodeForWorkflow(WorkflowHistory workflowHistory, String node) { Map<String, Object> map = new HashMap<>(); DateFormat sdFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); map.put("id", node + "/" + workflowHistory.getJobStringId()); map.put("rowid", workflowHistory.getId()); map.put("workflowId", workflowHistory.getWorkflowId()); map.put("jobId", workflowHistory.getJobId()); map.put("jobStringId", workflowHistory.getJobStringId()); map.put("workflowName", workflowHistory.getWorkflowName()); map.put("workflowXml", workflowHistory.getWorkflowXml()); map.put("currentAction", workflowHistory.getCurrentAction()); map.put("jobName", workflowHistory.getJobName()); map.put("variable", workflowHistory.getVariable()); map.put("startDate", sdFormat.format(workflowHistory.getStartDate())); map.put("endDate", sdFormat.format(workflowHistory.getEndDate())); map.put("elapsed", workflowHistory.getElapsed()); map.put("cause", workflowHistory.getCause()); map.put("currentStep", workflowHistory.getCurrentStep()); map.put("totalStep", workflowHistory.getTotalStep()); map.put("exception", workflowHistory.getException()); map.put("status", workflowHistory.getStatus()); map.put("username", workflowHistory.getUsername()); map.put("jobType", workflowHistory.getJobType()); map.put("logPath", workflowHistory.getLogPath()); map.put("sf_parentIdentifier", workflowHistory.getSf_parentIdentifier()); map.put("sf_rootIdentifier", workflowHistory.getSf_rootIdentifier()); map.put("sf_depth", workflowHistory.getSf_depth()); map.put("sf_taskId", workflowHistory.getSf_taskId()); map.put("cls", ""); map.put("iconCls", "x-tree-noicon"); map.put("text", workflowHistory.getWorkflowName()); map.put("leaf", false); map.put("type", "workflow"); return map; }