我用的是jbpm4.0,当我用taskService.findGroupTasks(String userId)取出该组里面的人对应的可以候选的任务列表时,总是取不出任务信息,列表长的为0。(注:前面已经有任务分配到这个组了)请问一下还有别的方法可以去到某个群组里面对应的所有的任务吗?(注:api里面没有提供相应的方法)

解决方案 »

  1.   

    根据group应该找得到所有的task owner IDs. 或者你找下4的源码看下里面默认配置好的name query, 应该不难写个新的HQL
    这里说的版本是3  /**
       * get all the task instances for all the given actorIds.
       */
      public List findTaskInstances(String[] actorIds) {
        List result = null;
        try {
          Query query = session.getNamedQuery("TaskMgmtSession.findTaskInstancesByActorIds");
          query.setParameterList("actorIds", actorIds);
          result = query.list();
        } catch (Exception e) {
          log.error(e);
          jbpmSession.handleException();
          throw new JbpmException("couldn't get task instances list for actors '"+actorIds+"'", e);
        } 
        return result;
      }