AnsweredAssumed Answered

Customizing user/groups queries

Question asked by miljanmk on Oct 20, 2011
Latest reply on Oct 21, 2011 by trademak
Querying user task by candidate user returns tasks assigned to candidate user or group that candidate user belongs to. In order to execute such query activiti creates TaskQueryImpl that contains information about candidateUser, end then, when executes query, fetches all groups for that user (see code snippet below - copied from org.activiti.engine.impl.TaskQueryImpl).

  protected List<String> getGroupsForCandidateUser(String candidateUser) {
    List<Group> groups = Context
      .getCommandContext()
      .getGroupManager()
      .findGroupsByUser(candidateUser);
    List<String> groupIds = new ArrayList<String>();
    for (Group group : groups) {
      groupIds.add(group.getId());
    }
    return groupIds;
  }

I wonder what should i do in order to fetch groups for particular user? As long as i can see, one of solutions is to override task service and provide it with own implementation of getGroupsForCandidateUser task query's function, the other one is to override org.activiti.engine.impl.persistence.entity.GroupManager?

I want to use my own user management tables. I thought the only thing that should be done in order to use own user manager implementation was to override org.activiti.engine.IdentityService, but I came to this problem. So, for some things I need to override IdentityService, for the others TaskService . . .
Why are functions needed to implement this feature spreaded over more than one interfaces? Maybe i am wrong?

Outcomes