Package com.founder.fix.fixflow.shell

Examples of com.founder.fix.fixflow.shell.FlowUtilServiceImpl


    Map<String,Object> resultMap = new HashMap<String,Object>();
    String userId = StringUtil.getString(filter.get("userId"));
    ProcessEngine engine = getProcessEngine(userId);
    RuntimeService runtimeService = engine.getRuntimeService();
    IdentityService identityService = engine.getIdentityService();
    FlowUtilServiceImpl flowUtil = new FlowUtilServiceImpl();
    String processDefinitionKey = StringUtil.getString(filter.get("processDefinitionKey"));
    String processInstanceId    = StringUtil.getString(filter.get("processInstanceId"));
    String title        = StringUtil.getString(filter.get("title"));
//    String subject        = StringUtil.getString(filter.get("subject"));
    String bizKey        = StringUtil.getString(filter.get("bizKey"));
    String initor        = StringUtil.getString(filter.get("initor"));
    String status        = StringUtil.getString(filter.get("status"));
    String processType       = StringUtil.getString(filter.get("processType"));
    ProcessInstanceType processInstanceStatus = FlowUtilServiceImpl.getInstanceStaus(status);
    try{
     
      String pageI = StringUtil.getString(filter.get("pageIndex"));
      String rowI = StringUtil.getString(filter.get("pageSize"));
      int pageIndex=1;
      int rowNum   =15;
      if(StringUtil.isNotEmpty(pageI)){
        pageIndex = Integer.valueOf(pageI);
      }
      if(StringUtil.isNotEmpty(rowI)){
        rowNum = Integer.valueOf(rowI);
      }
      ProcessInstanceQuery processInstanceQuery = runtimeService.createProcessInstanceQuery();
      if(StringUtil.isNotEmpty(processDefinitionKey))
        processInstanceQuery.processDefinitionKey(processDefinitionKey);
      if(StringUtil.isNotEmpty(processInstanceId))
        processInstanceQuery.processInstanceId(processInstanceId);
      if(StringUtil.isNotEmpty(title))
        processInstanceQuery.subjectLike(title);
      if(StringUtil.isNotEmpty(bizKey))
        processInstanceQuery.processInstanceBusinessKeyLike(bizKey);
      if(processInstanceStatus !=null){
        processInstanceQuery.processInstanceStatus(processInstanceStatus);
      }
      if(StringUtil.isNotEmpty(initor))
        processInstanceQuery.initiator(initor);
     
     
      if(StringUtil.isNotEmpty(processType)){
        if(processType.equals("initor"))
          processInstanceQuery.initiator(userId);
        else
          processInstanceQuery.taskParticipants(userId);
      }
     
      String processDefinitionName     = StringUtil.getString(filter.get("processDefinitionName"));
      if(StringUtil.isNotEmpty(processDefinitionName))
        processInstanceQuery.processDefinitionNameLike(processDefinitionName);
     
      processInstanceQuery.orderByUpdateTime().desc();
      Date dates = null;
      Date datee = null;
      String dss = StringUtil.getString(filter.get("startTimeS"));
      String dse = StringUtil.getString(filter.get("startTimeE"));
      if(StringUtil.isNotEmpty(dss)){
        dates = DateUtil.stringToDate(dss,"yyyy-MM-dd");
      }
      if(StringUtil.isNotEmpty(dse)){
        String endTime = "235959999";
        dse += endTime;
        datee = DateUtil.stringToDate(dse,"yyyy-MM-ddHHmmssSSS");
      }
      if(dates!=null)
        processInstanceQuery.startTimeBefore(dates);
     
      if(datee!=null)
        processInstanceQuery.startTimeAfter(datee);
     
     
      List<ProcessInstance> processInstances = processInstanceQuery.listPagination(pageIndex, rowNum);
     
      List<Map<String,Object>> instanceMaps = new ArrayList<Map<String,Object>>();
      for(ProcessInstance tmp: processInstances){
        Map<String, Object> persistentState = tmp.getPersistentState();
        String processDefinitionId = tmp.getProcessDefinitionId();
        ProcessDefinitionBehavior processDefinitionBehavior = engine.getModelService().getProcessDefinition(processDefinitionId);
        String processDefinitionName1 = processDefinitionBehavior.getName();
        persistentState.put("processDefinitionName", processDefinitionName1);
        String nowNodeInfo = flowUtil.getShareTaskNowNodeInfo(tmp.getId());
        persistentState.put("nowNodeInfo", nowNodeInfo);
        UserTo user = identityService.getUserTo(tmp.getStartAuthor());
        if(user !=null){
          persistentState.put("startAuthorName", user.getUserName());
        }else{
View Full Code Here


    Map<String,Object> resultMap = new HashMap<String,Object>();
    String userId = StringUtil.getString(params.get("userId"));
    ProcessEngine engine = getProcessEngine(userId);
    RuntimeService runtimeService = engine.getRuntimeService();
    IdentityService identityService = engine.getIdentityService();
    FlowUtilServiceImpl flowUtil = new FlowUtilServiceImpl();
    String processName = StringUtil.getString(params.get("processName"));
    String processInstanceId    = StringUtil.getString(params.get("processInstanceId"));
    String subject        = StringUtil.getString(params.get("subject"));
    String bizKey        = StringUtil.getString(params.get("bizKey"));
    String initor        = StringUtil.getString(params.get("initor"));
    String status        = StringUtil.getString(params.get("status"));
    ProcessInstanceType processInstanceStatus = FlowUtilServiceImpl.getInstanceStaus(status);
    try{
     
      String pageI = StringUtil.getString(params.get("pageIndex"));
      String rowI = StringUtil.getString(params.get("pageSize"));
      int pageIndex=1;
      int rowNum   =15;
      if(StringUtil.isNotEmpty(pageI)){
        pageIndex = Integer.valueOf(pageI);
      }
      if(StringUtil.isNotEmpty(rowI)){
        rowNum = Integer.valueOf(rowI);
      }
      ProcessInstanceQuery processInstanceQuery = runtimeService.createProcessInstanceQuery();
      if(StringUtil.isNotEmpty(processName)){
//        QueryExpandTo queryExpandTo = new QueryExpandTo();
//        //增加扩展查询的left join语句
//        List<Object> paraObjs = new ArrayList<Object>();
//        paraObjs.add("%"+processName+"%");
//        queryExpandTo.setLeftJoinSql("left join fixflow_def_processdefinition pd on PD.process_id = E.processdefinition_id");
//        queryExpandTo.setWhereSql(" PD.process_name like ? ");
//        queryExpandTo.setWhereSqlObj(paraObjs);
//        processInstanceQuery.queryExpandTo(queryExpandTo);
        processInstanceQuery.processDefinitionNameLike(processName);
       
      }
      if(StringUtil.isNotEmpty(processInstanceId))
        processInstanceQuery.processInstanceId(processInstanceId);
      if(StringUtil.isNotEmpty(subject))
        processInstanceQuery.subjectLike(subject);
      if(StringUtil.isNotEmpty(bizKey))
        processInstanceQuery.processInstanceBusinessKeyLike(bizKey);
      if(StringUtil.isNotEmpty(initor))
        processInstanceQuery.initiatorLike(initor);
      if(processInstanceStatus !=null){
        processInstanceQuery.processInstanceStatus(processInstanceStatus);
      }
      processInstanceQuery.orderByUpdateTime().desc();
      List<ProcessInstance> processInstances = processInstanceQuery.listPagination(pageIndex, rowNum);
     
      List<Map<String,Object>> instanceMaps = new ArrayList<Map<String,Object>>();
      for(ProcessInstance tmp: processInstances){
        Map<String, Object> persistentState = tmp.getPersistentState();
        String processDefinitionId = tmp.getProcessDefinitionId();
        ProcessDefinitionBehavior processDefinitionBehavior = engine.getModelService().getProcessDefinition(processDefinitionId);
        String processDefinitionName = processDefinitionBehavior.getName();
        persistentState.put("processDefinitionName", processDefinitionName);
        String nowNodeInfo = flowUtil.getShareTaskNowNodeInfo(tmp.getId());
        persistentState.put("nowNodeInfo", nowNodeInfo);
        UserTo user = identityService.getUserTo(tmp.getStartAuthor());
        if(user !=null){
          persistentState.put("startAuthorName", user.getUserName());
        }else{
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.shell.FlowUtilServiceImpl

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.