private Map getNodeForTask(TaskHistory taskHistory, String node) {
    Map<String, Object> map = new HashMap<>();
    map.put("id", node + "/" + taskHistory.getTaskId());
    map.put("rowid", taskHistory.getId());
    map.put("taskId", taskHistory.getTaskId());
    map.put("identifier", taskHistory.getIdentifier());
    map.put("status", taskHistory.getStatus());

    map.put("cls", "");
    map.put("iconCls", "x-tree-noicon");
    map.put("text", taskHistory.getName());
    map.put("leaf", true);
    map.put("type", "task");
    return map;
  }
 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;
 }