Package com.sogou.qadev.service.cynthia.bean

Examples of com.sogou.qadev.service.cynthia.bean.Flow


   
    if (bugTemplate == null) {
      return "";
    }
   
     Flow flow = das.queryFlow(bugTemplate.getFlowId());
     if (flow != null) {
       for (Stat stat : flow.getStats()) {
          allFieldSet.add(new StatisticField(stat.getId().getValue(), stat.getName()));
       }
    }
    
    return com.alibaba.fastjson.JSONArray.toJSONString(allFieldSet);
View Full Code Here


   
    Template template = das.queryTemplate(templateId);
    if (template == null) {
      return "";
    }
    Flow flow = das.queryFlow(template.getFlowId());
    if (flow == null) {
      return "";
    }
   
    Role[] allRoles = flow.getRoles();

    JSONArray json = JSONArray.fromObject(allRoles);
    return json.toString();
  }
View Full Code Here

    }
    UUID roleId = DataAccessFactory.getInstance().createUUID(roleIdStr);
   
    Template template = das.queryTemplate(DataAccessFactory.getInstance().createUUID(templateIdStr));
   
    Flow flow = das.queryFlow(template.getFlowId());
   
    List<UserInfo> allQuitUserList = getAllQuitUser(template, flow, roleId);
   
    JSONArray json = JSONArray.fromObject(allQuitUserList);
    return json.toString();
View Full Code Here

    }
    UUID roleId = DataAccessFactory.getInstance().createUUID(roleIdStr);
   
    Template template = das.queryTemplate(DataAccessFactory.getInstance().createUUID(templateIdStr));
   
    Flow flow = das.queryFlow(template.getFlowId());
   
    List<UserInfo> allQuitUserList = flow.queryAllUserInfo(roleId);
    JSONArray json = JSONArray.fromObject(allQuitUserList);
    return json.toString();
  }
View Full Code Here

    UUID templateId = DataAccessFactory.getInstance().createUUID(templateIdStr);
    Template template = das.queryTemplate(templateId);
    if (template == null || userName == null || userName.equals("") ) {
      return "";
    }
    Flow flow = das.queryFlow(template.getFlowId());
    if (flow == null ) {
      return "";
    }
    List<Data> allDatas = getTemplateUserNoCloseData(template, flow, userName);
    JSONArray json = JSONArray.fromObject(allDatas);
View Full Code Here

   
    Template template = das.queryTemplate(templateId);
    if (template == null) {
      return "无法找到该表单";
    }
    Flow flow = das.queryFlow(template.getFlowId());
    if (flow == null) {
      return "无法找到该流程";
    }
   
    List<String> allQuitUser = new ArrayList<String>();
    if (quitUserName != null && quitUserName.equals("all")) {
      List<UserInfo> allQuitUserList =  getAllQuitUser(template, flow, roleId);
      for (UserInfo userInfo : allQuitUserList) {
        allQuitUser.add(userInfo.getUserName());
      }
    }else {
      allQuitUser.add(quitUserName);
    }
   
    List<Data> allNeedMoveDataList = new ArrayList<Data>();
    for (String user : allQuitUser) {
      allNeedMoveDataList.addAll(getTemplateUserNoCloseData(template, flow, user));
    }
   
    StringBuffer errorDataBuffer = new StringBuffer();
   
    for (Data tempData : allNeedMoveDataList) {
      Data data = das.queryData(tempData.getId(), templateId);
      if (data != null) {
        try {
          Map<String, Pair<Object, Object>> baseValueMap = new HashMap<String, Pair<Object,Object>>();
          Map<UUID, Pair<Object, Object>> extValueMap =  new HashMap<UUID, Pair<Object,Object>>();
         
          if(data.getAssignUsername() == null && newUserName != null || data.getAssignUsername() != null && newUserName == null
            || data.getAssignUsername() != null && newUserName != null && !data.getAssignUsername().equals(newUserName)){
            baseValueMap.put("assignUser", new Pair<Object, Object>(data.getAssignUsername(), newUserName));
          }
         
          data.setAssignUsername(newUserName);
         
          data.setObject("logCreateUser", key.getUsername());
         
          data.setObject("logActionId", null);
         
          if(actionComment != null && actionComment.length() > 0){
            data.setObject("logActionComment", actionComment);
          }else {
            data.setObject("logActionComment", "");
          }
         
          data.setObject("logBaseValueMap", baseValueMap);
          data.setObject("logExtValueMap", extValueMap);
         
          Pair<ErrorCode, String> result = das.modifyData(data);
         
          if(result.getFirst().equals(ErrorCode.success)){
            das.commitTranscation();
          }else{
            errorDataBuffer.append(errorDataBuffer.length() > 0 ?"," :"").append(XMLUtil.toSafeXMLString(data.getTitle()));
            das.rollbackTranscation();
          }
        } catch (Exception e) {
          errorDataBuffer.append(errorDataBuffer.length() > 0 ?"," :"").append(XMLUtil.toSafeXMLString(data.getTitle()));
          e.printStackTrace();
        }
      }
    }
    if (errorDataBuffer.length() > 0) {
      return "转移失败,错误数据有:" + errorDataBuffer.toString();
    }else {
      //从表单中删除人员
      Set<Right> allRights = flow.getRightSet();
      Iterator<Right> iterator = allRights.iterator();
      while (iterator.hasNext()) {
        if (allQuitUser.contains(iterator.next().getUsername())) {
          iterator.remove();
        }
      }
      flow.setRightSet(allRights);
      ErrorCode errorCode = das.updateFlow(flow);
      if (errorCode.equals(ErrorCode.success)) {
        das.updateCache(DataAccessAction.update, flow.getId().getValue(), flow);
      }else {
        das.rollbackTranscation();
      }
     
      //删除定时器数据
View Full Code Here

   */
  @ResponseBody
  @RequestMapping("/getTemplateStats.do")
  public String getTemplateStats(@RequestParam("templateId") String templateId) throws Exception {
    Template template = das.queryTemplate(DataAccessFactory.getInstance().createUUID(templateId));
    Flow flow = das.queryFlow(template.getFlowId());
    Stat[] stats = flow.getStats();
    JSONArray json = JSONArray.fromObject(stats);
    return json.toString();
  }
View Full Code Here

  @ResponseBody
  public String initTemplateActionAndStat(@RequestParam("templateId") String templateId, @RequestParam("scriptId") String scriptId) throws Exception {
    StringBuffer result = new StringBuffer(this.baseXml);
   
    Template template = das.queryTemplate(DataAccessFactory.getInstance().createUUID(templateId));
    Flow flow       = das.queryFlow(template.getFlowId());
    Script script     = null;
    UUID[] actionIds  = null;
    UUID[] endStatIds = null;
    if(scriptId!=null&&!"".equals(scriptId))
    {
      script = das.queryScript(DataAccessFactory.getInstance().createUUID(scriptId));
    }
    if(script != null)
    {
      actionIds  = script.getActionIds();
      endStatIds = script.getEndStatIds();
    }
   
    Action[] flowActions = flow.getActions();
    Stat[]   flowStats   = flow.getStats();
    result.append("<template>");
    result.append("<actions>");
    for(Action action : flowActions)
    {
      result.append("<action>");
View Full Code Here

        oldTemplateIdsList.add(DataAccessFactory.getInstance().createUUID(templateId));
      script.setTemplateIds(oldTemplateIdsList.toArray(new UUID[oldTemplateIdsList.size()]));
    }
   
    Template newTemplate = das.queryTemplate(DataAccessFactory.getInstance().createUUID(templateId));
    Flow     newFlow     = das.queryFlow(newTemplate.getFlowId());
    Stat[]   newFlowStats= newFlow.getStats();
    Action[] newFlowActions=newFlow.getActions();
    List<UUID> newFlowStatIds = new ArrayList<UUID>();
    List<UUID> newFlowActionIds = new ArrayList<UUID>();
    for(Stat stat : newFlowStats)
    {
      newFlowStatIds.add(stat.getId());
View Full Code Here

        newFlowIds.add(template.getFlowId());
    }
    Template removedTemplate = das.queryTemplate(DataAccessFactory.getInstance().createUUID(templateId));
    if(!newFlowIds.contains(removedTemplate.getFlowId()))
    {
      Flow removedFlow = das.queryFlow(removedTemplate.getFlowId());
      Stat[] removedFlowStats = removedFlow.getStats();
      for(Stat stat : removedFlowStats)
      {
        if(oldStatIdsList.contains(stat.getId()))
          oldStatIdsList.remove(stat.getId());
      }
     
      Action[] removedFlowActions = removedFlow.getActions();
      for(Action action : removedFlowActions)
      {
        if(oldActionIdsList.contains(action.getId()))
        {
          oldActionIdsList.remove(action.getId());
View Full Code Here

TOP

Related Classes of com.sogou.qadev.service.cynthia.bean.Flow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.