Package org.activiti.engine.identity

Examples of org.activiti.engine.identity.GroupQuery


      throw new ActivitiException("No user provided");
    }
   
    TaskService ts = ActivitiUtil.getTaskService();
   
    GroupQuery query = ActivitiUtil.getIdentityService()
      .createGroupQuery()
      .groupMember(user)
      .groupType("assignment");
   
    List<Group> groups = query.list();
    ObjectNode groupsJSON = new ObjectMapper().createObjectNode();
    for (Group group : groups) {
      long tasksInGroup = ts.createTaskQuery().taskCandidateGroup(group.getId()).count();
      groupsJSON.put(group.getName(), tasksInGroup);
    }
View Full Code Here


  @Autowired
  protected IdentityService identityService;
 
  @RequestMapping(value="/identity/groups", method = RequestMethod.GET, produces = "application/json")
  public DataResponse getGroups(@RequestParam Map<String,String> allRequestParams, HttpServletRequest request) {
    GroupQuery query = identityService.createGroupQuery();
   
    if (allRequestParams.containsKey("id")) {
      query.groupId(allRequestParams.get("id"));
    }
    if (allRequestParams.containsKey("name")) {
      query.groupName(allRequestParams.get("name"));
    }
    if (allRequestParams.containsKey("nameLike")) {
      query.groupNameLike(allRequestParams.get("nameLike"));
    }
    if (allRequestParams.containsKey("type")) {
      query.groupType(allRequestParams.get("type"));
    }
    if (allRequestParams.containsKey("member")) {
      query.groupMember(allRequestParams.get("member"));
    }
    if (allRequestParams.containsKey("potentialStarter")) {
      query.potentialStarter(allRequestParams.get("potentialStarter"));
    }

    return new GroupPaginateList(restResponseFactory, request.getRequestURL().toString().replace("/identity/groups", ""))
        .paginateList(allRequestParams, query, "id", properties);
  }
View Full Code Here

    super.tearDown();
  }
 
  public void testQueryById() {
    GroupQuery query = identityService.createGroupQuery().groupId("muppets");
    verifyQueryResults(query, 1);
  }
View Full Code Here

    GroupQuery query = identityService.createGroupQuery().groupId("muppets");
    verifyQueryResults(query, 1);
  }
 
  public void testQueryByInvalidId() {
    GroupQuery query = identityService.createGroupQuery().groupId("invalid");
    verifyQueryResults(query, 0);
   
    try {
      identityService.createGroupQuery().groupId(null).list();
      fail();
View Full Code Here

      fail();
    } catch (ActivitiIllegalArgumentException e) {}
  }
 
  public void testQueryByName() {
    GroupQuery query = identityService.createGroupQuery().groupName("Muppet show characters");
    verifyQueryResults(query, 1);
   
    query = identityService.createGroupQuery().groupName("Famous frogs");
    verifyQueryResults(query, 1);
  }
View Full Code Here

    query = identityService.createGroupQuery().groupName("Famous frogs");
    verifyQueryResults(query, 1);
  }
 
  public void testQueryByInvalidName() {
    GroupQuery query = identityService.createGroupQuery().groupName("invalid");
    verifyQueryResults(query, 0);
   
    try {
      identityService.createGroupQuery().groupName(null).list();
      fail();
View Full Code Here

      fail();
    } catch (ActivitiIllegalArgumentException e) {}
  }
 
  public void testQueryByNameLike() {
    GroupQuery query = identityService.createGroupQuery().groupNameLike("%Famous%");
    verifyQueryResults(query, 2);
   
    query = identityService.createGroupQuery().groupNameLike("Famous%");
    verifyQueryResults(query, 2);
   
View Full Code Here

    query = identityService.createGroupQuery().groupNameLike("%show%");
    verifyQueryResults(query, 1);
  }
 
  public void testQueryByInvalidNameLike() {
    GroupQuery query = identityService.createGroupQuery().groupNameLike("%invalid%");
    verifyQueryResults(query, 0);
   
    try {
      identityService.createGroupQuery().groupNameLike(null).list();
      fail();
View Full Code Here

      fail();
    } catch (ActivitiIllegalArgumentException e) {}
  }
 
  public void testQueryByType() {
    GroupQuery query = identityService.createGroupQuery().groupType("user");
    verifyQueryResults(query, 3);
   
    query = identityService.createGroupQuery().groupType("admin");
    verifyQueryResults(query, 0);
  }
View Full Code Here

    query = identityService.createGroupQuery().groupType("admin");
    verifyQueryResults(query, 0);
  }
 
  public void testQueryByInvalidType() {
    GroupQuery query = identityService.createGroupQuery().groupType("invalid");
    verifyQueryResults(query, 0);
   
    try {
      identityService.createGroupQuery().groupType(null).list();
      fail();
View Full Code Here

TOP

Related Classes of org.activiti.engine.identity.GroupQuery

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.