/**
   * 跳转到编辑页面
   *
   * @return
   */
  public String toedit() {
    try {
      int systemID = form.getSystemIDValue();
      String eventFlowName = form.getEventFlowName();
      if (systemID <= 0 || eventFlowName == null) {
        return Action.ERROR;
      }

      EventFlowDTO dto = new EventFlowDTO();
      dto.setSystemID(systemID);
      dto.setEventFlowName(eventFlowName);
      // 查询KV事件列表
      this.eventList = this.service.listKVEvent(dto);
      // 查询事件流详情
      this.eventFlowList = this.service.getTheKVEventFlow(dto);

      if (eventFlowList != null && eventFlowList.size() > 0) {
        form.setEventFlowName(eventFlowList.get(0).getEventFlowName());
      }

      LogUtil.log(dto, "事件流-跳转到编辑页面");

      return "edit";
    } catch (Exception e) {
      e.printStackTrace();
      return null;
    }
  }
  /**
   * 删除事件流
   *
   * @return
   */
  public String delete() {
    int systemID = form.getSystemIDValue();
    String eventFlowName = form.getEventFlowName();
    if (systemID == 0 || null == eventFlowName || "".equals(eventFlowName.trim())) {
      return Action.SUCCESS;
    }
    EventFlowDTO dto = new EventFlowDTO();
    dto.setSystemID(systemID);
    dto.setEventFlowName(eventFlowName);
    // 删除操作
    service.deleteKVEventFlow(dto);

    LogUtil.log(dto, "事件流-删除");

    return "success_redirect";
  }
  /**
   * 查询某个事件流详情
   *
   * @return
   */
  public String select() {
    int systemID = form.getSystemIDValue();
    String eventFlowName = form.getEventFlowName();
    if (systemID == 0 || null == eventFlowName || "".equals(eventFlowName.trim())) {
      return Action.SUCCESS;
    }

    EventFlowDTO dto = new EventFlowDTO();
    dto.setSystemID(systemID);
    dto.setEventFlowName(eventFlowName);
    // 查询某个事件流详情
    this.eventFlowList = this.service.getTheKVEventFlow(dto);

    LogUtil.log(dto, "事件流-详情");

    return Action.SUCCESS;
  }
  /**
   * 添加事件流
   *
   * @return
   */
  public String add() {
    int systemID = form.getSystemIDValue();
    String eventFlowName = form.getEventFlowName();
    String eventFlowDesc = form.getEventFlowDesc();
    String[] ids = form.getEventID();
    if (systemID == 0
        || null == eventFlowName
        || "".equals(eventFlowName.trim())
        || null == ids
        || "".equals(ids.length <= 0)) {
      return Action.SUCCESS;
    }

    List<EventFlowDTO> list = new ArrayList<EventFlowDTO>();
    EventFlowDTO dto = null;
    for (int i = 0, len = ids.length; i < len; i++) {
      dto = new EventFlowDTO();
      dto.setSystemID(systemID);
      dto.setEventFlowName(eventFlowName);
      dto.setEventFlowDesc(eventFlowDesc == null ? "" : eventFlowDesc);
      dto.setEventFlowStep(i + 1);
      dto.setFinalEventID(ids[i]);
      list.add(dto);
    }
    // 添加操作
    service.addKVEventFlow(list);

    LogUtil.log(dto, "事件流-添加");

    form.setTips("事件流添加成功!");
    return "success_redirect";
  }