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

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


          }else if(type.equals("t")){
            Template template = TemplateCache.getInstance().get(id);
            if(template == null){
              continue;
            }
            Flow flow = FlowCache.getInstance().get(template.getFlowId());
            if (flow == null) {
              continue;
            }
            flowList.add(flow);
          }
         
          for(Flow flow : flowList){
            if(flow == null){
              continue;
            }
           
            if(fieldValue.equals("[逻辑开始]") && flow.getBeginStats() != null){
              for(Stat stat : flow.getBeginStats()){
                if(statusIdStrb.length() > 0){
                  statusIdStrb.append(",");
                }
               
                statusIdStrb.append(stat.getId());
              }
            }
            else if(fieldValue.equals("[逻辑关闭]") && flow.getEndStats() != null){
              for(Stat stat : flow.getEndStats()){
                if(statusIdStrb.length() > 0){
                  statusIdStrb.append(",");
                }
               
                statusIdStrb.append(stat.getId());
              }
            }
          }
         
          if(statusIdStrb.length() == 0){
            continue;
          }
         
          if(fieldMethod.equals("=")){
            XMLUtil.setAttribute(whereFieldNode, "method", "in");
          }
          else if(fieldMethod.equals("!=")){
            XMLUtil.setAttribute(whereFieldNode, "method", "not in");
          }
         
          whereFieldNode.setTextContent(statusIdStrb.toString());
        }
       
       
        //创建人 指派人可以指派给角色
        if((fieldId.equals("create_user") || fieldId.equals("assign_user") || fieldId.equals("log_create_user")) && (fieldValue.startsWith("role_"))){
         
          String roleIdStr = fieldValue.substring(5);
         
          if (!CommonUtil.isPosNum(roleIdStr))
            continue;
         
          StringBuffer roleUsers = new StringBuffer();
          if (type.equals("t")) {
            Template template = TemplateCache.getInstance().get(id);
            if(template == null){
              continue;
            }
            Flow flow = FlowCache.getInstance().get(template.getFlowId());
            if (flow == null) {
              continue;
            }
            UUID roleId = DataAccessFactory.getInstance().createUUID(roleIdStr);
            Set<Right> allRoleRight = flow.queryRightsByRole(roleId);
           
            for (Right right : allRoleRight) {
              roleUsers.append(roleUsers.length() > 0 ? "," : "").append(right.getUsername());
            }
          }
View Full Code Here


     
      Template template = templateMap.get(task.getTemplateId());
      if(template == null)
        continue;
      if (flowMap.get(template.getFlowId()) == null) {
        Flow flow = das.queryFlow(template.getFlowId());
        if (flow != null) {
          flowMap.put(flow.getId(), flow);
        }
      }
     
      Flow flow = flowMap.get(template.getFlowId());
     
      if(i>0)
        result.append(",");
     
      boolean isNewTask = !notNewTaskIdSet.contains(task.getId().getValue());   
View Full Code Here

  @RequestMapping("/getActionRole.do")
  @ResponseBody
  public String getActionRole(HttpServletRequest request, HttpServletResponse response ,HttpSession session) throws Exception {
    String actionId = request.getParameter("actionId");
    String flowId = request.getParameter("flowId");
    Flow flow = das.queryFlow(DataAccessFactory.getInstance().createUUID(flowId));
    if (flow == null) {
      return "";
    }
   
    Action action = flow.getAction(DataAccessFactory.getInstance().createUUID(actionId));
   
    Map<String, Object> roleMap = new HashMap<String, Object>();
    List<FlowField> allRoleList = new ArrayList<FlowController.FlowField>();
   
    Set<Action> allStartActions = flow.getStartActions();
   
    if(action == null){
      allRoleList.add(new FlowField(Role.everyoneUUID.getValue(), Role.everyoneName));
    }else{
      for(Action startAction : allStartActions){
        //只有新建动作有everyone角色
        if (startAction != null && startAction.getId().getValue().equals(actionId)) {
          allRoleList.add(new FlowField(Role.everyoneUUID.getValue(), Role.everyoneName));
          break;
        }
      }
    }
   
    for (Role role : flow.getRoles()) {
      allRoleList.add(new FlowField(role.getId().getValue(), role.getName()));
    }
   
    roleMap.put("allRole", allRoleList);
   
   
    if (actionId != null && actionId != "") {
     
      List<FlowField> allActionRoleList = new ArrayList<FlowController.FlowField>();
      Role[] allActionRoles = flow.queryActionRoles(DataAccessFactory.getInstance().createUUID(actionId));
      for (Role role : allActionRoles) {
        allActionRoleList.add(new FlowField(role.getId().getValue(), role.getName()));
      }
     
      if (flow.isActionEveryoneRole(DataAccessFactory.getInstance().createUUID(actionId))) {
        allActionRoleList.add(new FlowField(Role.everyoneUUID.getValue(), Role.everyoneName));
      }
      roleMap.put("actionRole", allActionRoleList);
    }
    return JSONArray.toJSONString(roleMap);
View Full Code Here

  @RequestMapping("/saveFlowSvg.do")
  @ResponseBody
  public String saveFlowSvg(HttpServletRequest request, HttpServletResponse response ,HttpSession session) throws Exception {
   
    String flowId = request.getParameter("flowId");
    Flow flow = das.queryFlow(DataAccessFactory.getInstance().createUUID(flowId));
    if (flow == null) {
      return "false";
    }
   
    String svgCode = request.getParameter("svgCode");
View Full Code Here

  @RequestMapping("/getFlowXml.do")
  @ResponseBody
  public String getFlowXml(HttpServletRequest request, HttpServletResponse response ,HttpSession session) throws Exception {
   
    String flowId = request.getParameter("flowId");
    Flow flow = das.queryFlow(DataAccessFactory.getInstance().createUUID(flowId));
    if (flow == null) {
      return "";
    }
    else {
      return flow.toXMLString();
    }
  }
View Full Code Here

     
      if (template == null) {
      return "";
    }
     
    Flow flow = das.queryFlow(template.getFlowId());
    if (flow == null) {
      return "";
    }
   
    Set<FlowField> allRoleSet = new HashSet<FlowController.FlowField>();
    for (Role role : flow.getRoles()) {
      allRoleSet.add(new FlowField(role.getId().getValue(), role.getName()));
    }
    return JSONArray.toJSONString(allRoleSet);
  }
View Full Code Here

     
      if (template == null) {
      return "";
    }
     
    Flow flow = das.queryFlow(template.getFlowId());
    if (flow == null) {
      return "";
    }
   
    Set<FlowField> allRoleSet = new HashSet<FlowController.FlowField>();
    for (Action action : flow.getActions()) {
      allRoleSet.add(new FlowField(action.getId().getValue(), action.getName()));
    }
    return JSONArray.toJSONString(allRoleSet);
  }
View Full Code Here

     
      if (template == null) {
      return "";
    }
     
    Flow flow = das.queryFlow(template.getFlowId());
    if (flow == null) {
      return "";
    }
   
    Action[] allActions = flow.queryRoleActions(roleId);
    Set<FlowField> allRoleSet = new HashSet<FlowController.FlowField>();
    for (Action action : allActions) {
      if (action != null) {
        allRoleSet.add(new FlowField(action.getId().getValue(), action.getName()));
      }
View Full Code Here

   
    Set<StatisticField> allFieldSet = new HashSet<BugStatisticController.StatisticField>();
   
     Template template = das.queryTemplate(DataAccessFactory.getInstance().createUUID(templateIdStr));
   
     Flow flow = das.queryFlow(template.getFlowId());
     if(fieldIdStr.equals("statusId")){
        for (Stat stat : flow.getStats()) {
          allFieldSet.add(new StatisticField(stat.getId().getValue(), stat.getName()));
       }
     }else if (fieldIdStr.equals("createUser") || fieldIdStr.equals("assignUser")) {
        List<UserInfo> allUsers = flow.queryAllUserInfo();
        for (UserInfo userInfo : allUsers) {
          allFieldSet.add(new StatisticField(userInfo.getUserName(), userInfo.getNickName()));
       }
    }else {
      Field field = template.getField(DataAccessFactory.getInstance().createUUID(fieldIdStr));
View Full Code Here

    String endTime = request.getParameter("endTime");
    String[] statisticOption = request.getParameterValues("statisticOption[]");
   
     Template template = das.queryTemplate(DataAccessFactory.getInstance().createUUID(templateIdStr));
    
     Flow flow = das.queryFlow(template.getFlowId());
    
     Timestamp startTimestamp = null;
     if (startTime != null && !startTime.equals("null") && startTime.length() > 0) {
      startTimestamp = Date.valueOf(startTime).toTimestamp();
    }
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.