Package com.founder.fix.fixflow.core.runtime

Examples of com.founder.fix.fixflow.core.runtime.TokenQuery


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


    Map<String,Object> resultMap = new HashMap<String,Object>();
    String userId = StringUtil.getString(params.get("userId"));
    ProcessEngine engine =  getProcessEngine(userId);
    try{
      RuntimeService runtimeService = engine.getRuntimeService();
      TokenQuery tokenQuery = runtimeService.createTokenQuery();
     
      String processInstanceId = StringUtil.getString(params.get("processInstanceId"));
      if(StringUtil.isNotEmpty(processInstanceId))
        tokenQuery.processInstanceId(processInstanceId);
     
      List<Token> tokenList = tokenQuery.list();
      List<Map<String,Object>> result = new ArrayList<Map<String,Object>>();
      for(Token tmp : tokenList){
        result.add(tmp.getPersistentState());
      }
     
View Full Code Here

    taskInstances = taskQuery.processDefinitionKey("TaskServiceNewTest").his().run().list();
    //验证归档表中可以到的任务个数不为0
    assertEquals(4, taskInstances.size());
   
    //创建令牌查询
    TokenQuery tokenQuery = runtimeService.createTokenQuery();
    //查询run表的对应令牌
    List<Token> tokens = tokenQuery.processInstanceId(processInstanceId).list();
    //验证run表中令牌已经不存在
    assertEquals(0, tokens.size());
   
    //重置令牌查询
    tokenQuery = runtimeService.createTokenQuery();
    //查his表中对应令牌
    tokens = tokenQuery.processInstanceId(processInstanceId).his().list();
    //验证令牌存在
    assertEquals(1, tokens.size());
    //验证历史表中的数据归档时间不为空
    assertNotNull(tokens.get(0).getArchiveTime());
   
    //重置令牌查询
    tokenQuery = runtimeService.createTokenQuery();
    //查run表中对应令牌
    tokens = tokenQuery.processInstanceId(processInstanceId).run().list();
    //验证令牌存在
    assertEquals(0, tokens.size());
       
    //重置令牌查询
    tokenQuery = runtimeService.createTokenQuery();
    //查his表和run表中对应令牌
    tokens = tokenQuery.processInstanceId(processInstanceId).his().run().list();
    //验证令牌存在
    assertEquals(1, tokens.size());
   
  }
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.runtime.TokenQuery

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.