Package com.founder.fix.fixflow.core.model

Examples of com.founder.fix.fixflow.core.model.ProcessDefinitionQuery


    ExpandClassConfig expandClassConfig=processEngineConfiguration.getExpandClassConfig();
    List<ExpandClass>  expandClasses=expandClassConfig.getExpandClass();
    for (ExpandClass expandClass : expandClasses) {
      if(expandClass.getClassId().equals("ProcessDefinitionQuery")){
        Object[] objTemp = new Object[] {commandExecutor}
        ProcessDefinitionQuery processDefinitionQuery =(ProcessDefinitionQuery) ReflectUtil.instantiate(expandClass.getClassImpl(),objTemp);
        return processDefinitionQuery;
      }
    }
    throw new FixFlowException("流程引擎扩展配置里的ProcessDefinitionQuery实现类指定错误");
  }
View Full Code Here


  @SuppressWarnings("rawtypes")
  public Map<String, Object> getProcessDefitionList(Map<String, Object> params) throws SQLException {
    Map<String,Object> resultMap = new HashMap<String,Object>();
    String userId = StringUtil.getString(params.get("userId"));
    ProcessEngine processEngine = getProcessEngine(userId);
    ProcessDefinitionQuery processDefinitionQuery = processEngine.getModelService().createProcessDefinitionQuery();
    try{
     
      String processName = StringUtil.getString(params.get("queryProcessName"));
      if(StringUtil.isNotEmpty(processName)){
        processDefinitionQuery.processDefinitionNameLike(processName);
      }
      String processId = StringUtil.getString(params.get("queryProcessId"));
      if(StringUtil.isNotEmpty(processId)){
        processDefinitionQuery.processDefinitionKeyLike(processId);
      }
      String processCategory = StringUtil.getString(params.get("queryType"));
      if(StringUtil.isNotEmpty(processCategory)){
        processDefinitionQuery.processDefinitionCategoryLike(processCategory);
      }
      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);
      }
     
//      QueryExpandTo queryExpandTo = new QueryExpandTo();
//      //添加扩展的字段
//      queryExpandTo.setFieldSql("fixflow_def_deployment.deploy_Time");
//      //增加扩展查询的left join语句
//      queryExpandTo.setLeftJoinSql("left join fixflow_def_deployment on PD.deployment_id = fixflow_def_deployment.id");
//      processDefinitionQuery.queryExpandTo(queryExpandTo);
      processDefinitionQuery.orderByDeploymentTime().desc();
      List<ProcessDefinitionBehavior> processDefinitions = processDefinitionQuery.listPagination(pageIndex, rowNum);
      Long count = processDefinitionQuery.count();
      List<Map<String,Object>> processDefinitionList = new ArrayList<Map<String,Object>>();
      Pagination page = new Pagination(pageIndex,rowNum);
      page.setTotal(count.intValue());
      for(ProcessDefinitionBehavior processDefinition:processDefinitions){
        Map<String,Object> processDefinitonMap = processDefinition.getPersistentState();
View Full Code Here

    String processKey = fileName.substring(0, fileName.lastIndexOf("."));
      List<Map<String, Object>> resultMaps = new ArrayList<Map<String,Object>>();
      ProcessEngine processEngine = getProcessEngine(userId);
      if(processEngine != null){
        ModelService modelService = processEngine.getModelService();
        ProcessDefinitionQuery processDefinitionQuery = modelService.createProcessDefinitionQuery();
        processDefinitionQuery.processDefinitionKey(processKey);
        processDefinitionQuery.orderByProcessDefinitionVersion().desc();
        List<ProcessDefinitionBehavior> processDefinitionBehaviors = processDefinitionQuery.list();
        for(ProcessDefinitionBehavior processDefinitionBehavior :processDefinitionBehaviors){
          resultMaps.add(processDefinitionBehavior.getPersistentState());
        }
      }
      ObjectMapper objectMapper = new ObjectMapper();
View Full Code Here

    //发布
    deploymentIdTemp = deploymentBuilder2.deploy().getId();
    assertNotNull(deploymentIdTemp);
   
    //创建流程定义查询
    ProcessDefinitionQuery processDefinitionQuery = modelService.createProcessDefinitionQuery();
    //查询发布号为deploymentIdTemp的流程定义
    List<ProcessDefinitionBehavior> processDefinitionBehaviors = processDefinitionQuery.deploymentId(deploymentIdTemp).list();
    //验证是否为1个
    assertEquals(1, processDefinitionBehaviors.size());
   
    //创建流程定义查询
    processDefinitionQuery = modelService.createProcessDefinitionQuery();
    //查询分类为测试流程定义分类的流程定义
    processDefinitionBehaviors = processDefinitionQuery.processDefinitionCategory("测试流程定义分类").list();
    //验证是否为1个
    assertEquals(1, processDefinitionBehaviors.size());
   
    //创建流程定义查询
    processDefinitionQuery = modelService.createProcessDefinitionQuery();
    //查询分类like测试流程定的流程定义
    processDefinitionBehaviors = processDefinitionQuery.processDefinitionCategoryLike("测试流程定").list();
    //验证是否为1个
    assertEquals(1, processDefinitionBehaviors.size());
   
    //创建流程定义查询
    processDefinitionQuery = modelService.createProcessDefinitionQuery();
    //查询startProcessByUser的版本号为1的流程定义
    processDefinitionBehaviors = processDefinitionQuery.processDefinitionKey("startProcessByUser").processDefinitionVersion(1).list();
    //验证是否为1个
    assertEquals(1, processDefinitionBehaviors.size());
   
    //创建流程定义查询
    processDefinitionQuery = modelService.createProcessDefinitionQuery();
    //查询流程名称等于指定启动人权限的StartProcessInstanceTest流程的流程定义
    processDefinitionBehaviors = processDefinitionQuery.processDefinitionName("指定启动人权限的StartProcessInstanceTest流程").list();
    //验证是否为1个
    assertEquals(1, processDefinitionBehaviors.size());
   
    //创建流程定义查询
    processDefinitionQuery = modelService.createProcessDefinitionQuery();
    //查询流程名称like  StartProcessInstanceTest流程的的流程定义
    processDefinitionBehaviors = processDefinitionQuery.processDefinitionNameLike("StartProcessInstanceTest流程").list();
    //验证是否为2个
    assertEquals(2, processDefinitionBehaviors.size());
   
    String processDefinitionId = processDefinitionBehaviors.get(0).getProcessDefinitionId();
   
    //创建流程定义查询
    processDefinitionQuery = modelService.createProcessDefinitionQuery();
    //查询processDefinitionId的流程定义
    processDefinitionBehaviors = processDefinitionQuery.processDefinitionId(processDefinitionId).list();
    //验证是否为1个
    assertEquals(1, processDefinitionBehaviors.size());
  }
View Full Code Here

   * 测试流程定义查询
   */
  @Deployment(resources = { "com/founder/fix/fixflow/test/engine/api/task/TaskServiceTest.bpmn" })
  public void testProcessDefinitionQuery() {
    //创建一个查询
    ProcessDefinitionQuery processDefinitionQuery=modelService.createProcessDefinitionQuery();
    //因为方法上面的声明会自动发布流程,所以此刻可以查到这个流程信息
    processDefinitionQuery.processDefinitionKey("Process_TaskServiceTest");
    ProcessDefinitionBehavior processDefinitionBehavior=processDefinitionQuery.singleResult();
    //验证是否查到此流程发布的信息
    assertNotNull(processDefinitionBehavior);
  }
View Full Code Here

    deploymentBuilder.addClasspathResource("com/founder/fix/fixflow/test/engine/api/task/TaskServiceTest.bpmn");
    //发布
    String deploymentIdTemp = deploymentBuilder.deploy().getId();
    assertNotNull(deploymentIdTemp);
    //创建一个查询
    ProcessDefinitionQuery processDefinitionQuery=modelService.createProcessDefinitionQuery();
    //查询上面发布的流程
    processDefinitionQuery.processDefinitionKey("Process_TaskServiceTest");
    ProcessDefinitionBehavior processDefinitionBehavior=processDefinitionQuery.singleResult();
    //验证是否发布成功
    assertNotNull(processDefinitionBehavior);
   
  }
View Full Code Here

    deploymentBuilder.addClasspathResource("com/founder/fix/fixflow/test/engine/api/task/TaskServiceTest.bpmn");
    //发布
    String deploymentIdTemp = deploymentBuilder.deploy().getId();
    assertNotNull(deploymentIdTemp);
    //创建一个流程定义查询
    ProcessDefinitionQuery processDefinitionQuery=modelService.createProcessDefinitionQuery();
    //查询上面发布的流程定义
    processDefinitionQuery.processDefinitionKey("Process_TaskServiceTest");
    //获得刚发布的流程定义
    ProcessDefinitionBehavior processDefinitionBehavior=processDefinitionQuery.singleResult();
    //验证流程定义存在
    assertNotNull(processDefinitionBehavior);
    //删除定义部署,并级联删除其下的所有流程定义
    modelService.deleteDeployment(deploymentIdTemp, true);
    //重置流程定义查询
    processDefinitionQuery=modelService.createProcessDefinitionQuery();
    //查询上面发布的流程定义
    processDefinitionQuery.processDefinitionKey("Process_TaskServiceTest");
    //查找刚发布的流程定义
    processDefinitionBehavior=processDefinitionQuery.singleResult();
    //验证流程定义已经被删除
    assertNull(processDefinitionBehavior);
   
  }
View Full Code Here

    deploymentBuilder.addClasspathResource("com/founder/fix/fixflow/test/engine/api/task/TaskServiceTest.bpmn");
    //发布
    String deploymentIdTemp = deploymentBuilder.deploy().getId();
    assertNotNull(deploymentIdTemp);
    //创建一个流程定义查询
    ProcessDefinitionQuery processDefinitionQuery=modelService.createProcessDefinitionQuery();
    //查询刚刚发布的流程定义
    processDefinitionQuery.processDefinitionKey("Process_TaskServiceTest");
    ProcessDefinitionBehavior processDefinitionBehavior=processDefinitionQuery.singleResult();
    //验证是否发布成功
    assertNotNull(processDefinitionBehavior);
   
    //根据流程定义唯一编号获取流程图SVG
    String svgString=modelService.getFlowGraphicsSvg(processDefinitionBehavior.getProcessDefinitionId());
View Full Code Here

    deploymentBuilder.addClasspathResource("com/founder/fix/fixflow/test/engine/api/task/TaskServiceTest.bpmn");
    //发布
    String deploymentIdTemp = deploymentBuilder.deploy().getId();
    assertNotNull(deploymentIdTemp);
    //创建一个流程定义查询
    ProcessDefinitionQuery processDefinitionQuery=modelService.createProcessDefinitionQuery();
    //查询Process_TaskServiceTest的流程定义
    processDefinitionQuery.processDefinitionKey("Process_TaskServiceTest");
    //获取流程定义
    ProcessDefinitionBehavior processDefinitionBehavior=processDefinitionQuery.singleResult();
    //验证是否为空
    assertNotNull(processDefinitionBehavior);
   
    //根据流程定义唯一编号获取流程默认的表单formUri
    String formUri=modelService.getDefaultFromUri(processDefinitionBehavior.getProcessDefinitionId());
View Full Code Here

    //发布
    String deploymentIdTemp = deploymentBuilder.deploy().getId();
    //验证是否发布成功
    assertNotNull(deploymentIdTemp);
    //创建一个流程定义查询
    ProcessDefinitionQuery processDefinitionQuery=modelService.createProcessDefinitionQuery();
    //查询刚发布的流程定义
    processDefinitionQuery.processDefinitionKey("Process_TaskServiceTest");
    ProcessDefinitionBehavior processDefinitionBehavior=processDefinitionQuery.singleResult();
    //验证是否得到
    assertNotNull(processDefinitionBehavior);
   
    //根据流程定义唯一编号获取流程图img
    String imgPath=modelService.GetFlowGraphicsImgPath(processDefinitionBehavior.getProcessDefinitionId());
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.model.ProcessDefinitionQuery

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.