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

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


    Template template = TemplateCache.getInstance().get(templateId);
    if(template == null){
      return new Stat[0];
    }
   
    Flow flow = FlowCache.getInstance().get(template.getFlowId());
    if(flow == null){
      return new Stat[0];
    }
   
    return flow.getStats();
  }
View Full Code Here


    Template template = dataAccessSession.queryTemplate(data.getTemplateId());
    if (template == null) {
      return false;
    }
   
    Flow flow = dataAccessSession.queryFlow(template.getFlowId());
    if (flow == null) {
      return false;
    }
   
    ScriptAccessSession scriptAccessSession = dataAccessSession.createScriptAccessSession();
View Full Code Here

   * @return
   * @see com.sogou.qadev.cache.Cache#get(java.lang.String)
   */
  @Override
  public Flow get(String id){
    Flow tmp = null;
    Object flow = EhcacheHandler.getInstance().get(EhcacheHandler.FOREVER_CACHE,id);
    if (flow != null){
      if (flow instanceof Flow) {
        tmp = (Flow)flow;
      }
    }
    else{
      tmp = new FlowAccessSessionMySQL().queryFlowById(DataAccessFactory.getInstance().createUUID(id));
      if (tmp != null) {
        EhcacheHandler.getInstance().set(EhcacheHandler.FOREVER_CACHE,tmp.getId().getValue(), tmp);
      }
    }
    if (tmp == null) {
      logger.info("flow id : " + id + " is not in cache");
    }
View Full Code Here

  {
    Template template = das.queryTemplate(data.getTemplateId());
    if(template == null)
      return null;

    Flow flow = das.queryFlow(template.getFlowId());
    if(flow == null)
      return null;

    Stat stat = flow.getStat(data.getStatusId());
    if(stat == null)
      return null;

    return stat.getName();
  }
View Full Code Here

      if(nodeStatusSet.contains(template.getId() + "|" + data.getStatusId()))
        continue;

      nodeStatusSet.add(template.getId() + "|" + data.getStatusId());

      Flow flow = das.queryFlow(template.getFlowId());
      if(flow == null)
        continue;
      boolean isEditAllow = flow.isEditActionAllow(das.getUsername(), template.getId(), data.getAssignUsername(), data.getActionUser());

      if(isEditAllow){//具有编辑权限的人可以批量修改状态
        Stat[] allStats = flow.getStats();
        allStatSet.addAll(Arrays.asList(allStats));
      }
    }

    StringBuffer strb = new StringBuffer();
View Full Code Here

      if(nodeStatusSet.contains(template.getId() + "|" + data.getStatusId()))
        continue;

      nodeStatusSet.add(template.getId() + "|" + data.getStatusId());

      Flow flow = das.queryFlow(template.getFlowId());
      if(flow == null)
        continue;
      boolean isEditAllow = flow.isEditActionAllow(das.getUsername(), template.getId(), data.getAssignUsername(), data.getActionUser());
      Set<Action> actionSet = new LinkedHashSet<Action>();

      if(isEditAllow){//具有编辑权限的人可以批量关闭BUG add by lyl
        Action[] endActions = flow.getEndActions();
        for(int i=0;endActions!=null && i<endActions.length;i++){
          actionSet.add(endActions[i]);
        }
      }
      for(Action action : actionSet)
      {
        String actionName = action.getName();
        if(action.getBeginStatId() == null)
          actionName = "激活--" + actionName;

        actionUserMap.put(actionName, new LinkedHashSet<String>());

        String[] userArray = flow.queryNodeStatAssignUsers(template.getId(), action.getEndStatId());
        if(userArray != null)
          actionUserMap.get(actionName).addAll(Arrays.asList(userArray));
      }
    }
View Full Code Here

      if(nodeStatusSet.contains(template.getId() + "|" + data.getStatusId()))
        continue;

      nodeStatusSet.add(template.getId() + "|" + data.getStatusId());

      Flow flow = das.queryFlow(template.getFlowId());
      if(flow == null)
        continue;

      boolean isEditAllow = flow.isEditActionAllow(das.getUsername(), template.getId(), data.getAssignUsername(), data.getActionUser());
      if(isEditAllow)
      {
        String[] assignUserArray = flow.queryNodeStatAssignUsers(template.getId(), data.getStatusId());
        if(assignUserArray != null)
        {
          if(!actionUserMap.containsKey("编辑"))
            actionUserMap.put("编辑", new LinkedHashSet<String>());

          actionUserMap.get("编辑").addAll(Arrays.asList(assignUserArray));
        }
      }

      Set<Action> actionSet = new LinkedHashSet<Action>();

      Action[] statActionArray = flow.queryStatActions(data.getStatusId());
      if(statActionArray == null || statActionArray.length == 0)
      {
        Action[] userNodeBeginActionArray = flow.queryUserNodeBeginActions(das.getUsername(), template.getId());
        for(int i = 0; userNodeBeginActionArray != null && i < userNodeBeginActionArray.length; i++)
          actionSet.add(userNodeBeginActionArray[i]);
      }
      else
      {
        Action[] userNodeStatActionArray = flow.queryUserNodeStatActions(das.getUsername(), template.getId(), data.getStatusId());
        for(int i = 0; userNodeStatActionArray != null && i < userNodeStatActionArray.length; i++)
          actionSet.add(userNodeStatActionArray[i]);
      }

      for(Action action : actionSet)
      {
        String actionName = action.getName();
        if(action.getBeginStatId() == null)
          actionName = "激活--" + actionName;

        actionUserMap.put(actionName, new LinkedHashSet<String>());

        String[] userArray = flow.queryNodeStatAssignUsers(template.getId(), action.getEndStatId());
        if(userArray != null)
          actionUserMap.get(actionName).addAll(Arrays.asList(userArray));
      }
    }
View Full Code Here

    for(Template template : templateArray)
    {
      if(templateTypeId != null && !template.getTemplateTypeId().equals(templateTypeId))
        continue;
     
      Flow flow = das.queryFlow(template.getFlowId());
      if(flow == null)
        continue;
     
      Action[] actionArray = flow.queryUserNodeBeginActions(das.getUsername(), template.getId());
      if(actionArray != null && actionArray.length > 0)
        templateSet.add(template);
    }

    return templateSet.toArray(new Template[0]);
View Full Code Here

    for(Template template : templateArray)
    {
      if(templateTypeId != null && !template.getTemplateTypeId().equals(templateTypeId))
        continue;
     
      Flow flow = das.queryFlow(template.getFlowId());
      if(flow == null)
        continue;
     
      if(flow.isRoleEditAction(Role.everyoneUUID) || flow.isRoleReadAction(Role.everyoneUUID))
      {
        //everyone 查看 编辑
        templateSet.add(template);
        continue;
      }
     
      //有everyone可操作的动作
      boolean isAdd = false;
      Action[] actionArray = flow.getActions();
      if(actionArray != null)
      {
        for(Action action : actionArray)
        {
          if(flow.isActionEveryoneRole(action.getId()))
          {
            isAdd = true;
            break;
          }
        }
      }
     
      if(isAdd)
      {
        templateSet.add(template);
        continue;
      }
     
      //其它角色查看
      List<Role> userRoleList = Arrays.asList(flow.queryUserNodeRoles(das.getUsername(), template.getId()));
      Role[] readActionRoles = flow.queryReadActionRoles();
     
      for(Role role : readActionRoles){
        if(userRoleList.contains(role)){
          templateSet.add(template);
        }
View Full Code Here

      return new Template[0];

    Set<Template> templateSet = new LinkedHashSet<Template>();
    for(Template template : templateArray)
    {
      Flow flow = das.queryFlow(template.getFlowId());
      if(flow == null)
        continue;
     
      Action[] actionArray = flow.queryUserNodeBeginActions(das.getUsername(), template.getId());
      if(actionArray != null && actionArray.length > 0)
        templateSet.add(template);
    }

    return templateSet.toArray(new Template[0]);
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.