// 我接收的流程
  @Action("tree-delegateAccept")
  public String delegateAccept() throws Exception {
    List<ZTreeNode> treeNodes = new ArrayList<ZTreeNode>();
    String name = getText("workflow.doing") + "(" + taskService.getAcceptTasksNum(false) + ")";
    ZTreeNode root = new ZTreeNode("ACC_ING", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);

    name = getText("workflow.complete") + "(" + taskService.getAcceptTasksNum(true) + ")";
    root = new ZTreeNode("ACC_END", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);
    renderText(JsonParser.object2Json(treeNodes));
    return null;
  }
  // 移交任务
  @Action("transfer-task-tree")
  public String transferTaskTree() throws Exception {
    List<ZTreeNode> treeNodes = new ArrayList<ZTreeNode>();
    String name =
        getText("workflow.doing")
            + "("
            + taskService.getTransferTaskNum(ContextUtils.getUserId(), false)
            + ")";
    ZTreeNode root =
        new ZTreeNode("TRANSFER_ING", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);

    name =
        getText("workflow.complete")
            + "("
            + taskService.getTransferTaskNum(ContextUtils.getUserId(), true)
            + ")";
    root = new ZTreeNode("TRANSFER_END", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);
    renderText(JsonParser.object2Json(treeNodes));
    return null;
  }
  // 我委托的流程
  @Action("tree-delegateMonitor")
  public String delegateMonitor() throws Exception {
    List<ZTreeNode> treeNodes = new ArrayList<ZTreeNode>();
    String name =
        getText("workflow.doing")
            + "("
            + taskService.getDelegateTasksNum(
                getCompanyId(), getCurrentUser(), ContextUtils.getUserId(), false)
            + ")";
    ZTreeNode root = new ZTreeNode("DEL_ING", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);

    name =
        getText("workflow.complete")
            + "("
            + taskService.getDelegateTasksNum(
                getCompanyId(), getCurrentUser(), ContextUtils.getUserId(), true)
            + ")";
    root = new ZTreeNode("DEL_END", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);
    renderText(JsonParser.object2Json(treeNodes));
    return null;
  }
  // 我受托的流程
  @Action("tree-superviseAsTrusteeTree")
  public String superviseAsTrusteeTree() throws Exception {
    List<ZTreeNode> treeNodes = new ArrayList<ZTreeNode>();
    String name =
        getText("workflow.doing")
            + "("
            + taskService.getTrusteeTasksNum(
                getCompanyId(), getCurrentUser(), ContextUtils.getUserId(), false)
            + ")";
    ZTreeNode root =
        new ZTreeNode("TRUSTEE_ING", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);

    name =
        getText("workflow.complete")
            + "("
            + taskService.getTrusteeTasksNum(
                getCompanyId(), getCurrentUser(), ContextUtils.getUserId(), true)
            + ")";
    root = new ZTreeNode("TRUSTEE_END", "0", name, "false", "false", "", "", "folder", "");
    treeNodes.add(root);
    renderText(JsonParser.object2Json(treeNodes));

    //		StringBuilder tree = new StringBuilder("[ ");
    //		tree.append(JsTreeUtils.generateJsTreeNodeDefault("TRUSTEE_ING", null,
    //				getText("workflow.doing") + "(" +
    //				taskService.getTrusteeTasksNum(getCompanyId(), getCurrentUser(),ContextUtils.getUserId(),
    // false) + ")" )).append(",");
    //		tree.append(JsTreeUtils.generateJsTreeNodeDefault("TRUSTEE_END", null,
    //				getText("workflow.complete") + "(" +
    //				taskService.getTrusteeTasksNum(getCompanyId(), getCurrentUser(),
    // ContextUtils.getUserId(),true) + ")" ));
    //
    //	tree.append(" ]");
    return null;
  }
 /**
  * 流程及表单类型树
  *
  * @return
  * @throws Exception
  */
 @Action("tree-wfTypes")
 public String wfTypes() throws Exception {
   List<ZTreeNode> treeNodes = new ArrayList<ZTreeNode>();
   List<WorkflowType> wfTypes = workflowTypeManager.getAllWorkflowType();
   List<BusinessSystem> businessSystemList = acsApiManager.getAllBusiness(getCompanyId());
   String result = "";
   if ("INITIALIZED_PROCESS".equals(currentId)) {
     ZTreeNode root =
         new ZTreeNode("ENABLE_ALL_1", "0", "当前版本", "true", "false", "", "", "folder", "");
     treeNodes.add(root);
     getSecondNodesInWftypeTree(wfTypes, businessSystemList, "ENABLE", treeNodes, "ENABLE_ALL_1");
     ZTreeNode UnenableRoot =
         new ZTreeNode("UNABLE_ALL_1", "0", "历史版本", "false", "false", "", "", "folder", "");
     treeNodes.add(UnenableRoot);
     getSecondNodesInWftypeTree(wfTypes, businessSystemList, "UNABLE", treeNodes, "UNABLE_ALL_1");
   } else if ("INITIALIZED_MONITOR".equals(currentId)) {
     ZTreeNode root =
         new ZTreeNode("WFT_monitor_0", "0", "当前实例", "true", "false", "", "", "folder", "");
     treeNodes.add(root);
     getSecondNodesInMonitorTree(wfTypes, treeNodes, "WFT_monitor_0");
     root =
         new ZTreeNode(
             "WFT_history_monitor_0", "0", "归档实例", "false", "false", "", "", "folder", "");
     treeNodes.add(root);
     getSecondNodesInMonitorHistoryTree(wfTypes, treeNodes, "WFT_history_monitor_0");
   } else if ("INITIALIZED_DICT".equals(currentId)) {
     ZTreeNode root =
         new ZTreeNode("WFT_myCreate_0", "0", "所有数据", "false", "false", "", "", "folder", "");
     treeNodes.add(root);
     root = new ZTreeNode("WFT_type_0", "0", "类型管理", "false", "false", "", "", "folder", "");
     treeNodes.add(root);
   } else if ("INITIALIZED_TEMPLATE".equals(currentId)) {
     ZTreeNode root =
         new ZTreeNode(
             "WFT_0",
             "0",
             getText("workflow.allTemplate"),
             "false",
             "false",
             "",
             "",
             "folder",
             "");
     treeNodes.add(root);
     for (WorkflowType wft : wfTypes) {
       root =
           new ZTreeNode(
               "WFT_" + wft.getId(), "0", wft.getName(), "false", "false", "", "", "folder", "");
       treeNodes.add(root);
     }
   } else if ("INITIALIZED_WFD_TEMPLATE".equals(currentId)) {
     ZTreeNode root =
         new ZTreeNode(
             "WFDT_0",
             "0",
             getText("workflow.allTemplate"),
             "false",
             "false",
             "",
             "",
             "folder",
             "");
     treeNodes.add(root);
     for (WorkflowType wft : wfTypes) {
       root =
           new ZTreeNode(
               "WFDT_" + wft.getId(), "0", wft.getName(), "false", "false", "", "", "folder", "");
       treeNodes.add(root);
     }
   }
   result = JsonParser.object2Json(treeNodes);
   renderText(result);
   return null;
 }