当前位置: 首页>>代码示例>>Java>>正文


Java GroupQuery类代码示例

本文整理汇总了Java中org.activiti.engine.identity.GroupQuery的典型用法代码示例。如果您正苦于以下问题:Java GroupQuery类的具体用法?Java GroupQuery怎么用?Java GroupQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GroupQuery类属于org.activiti.engine.identity包,在下文中一共展示了GroupQuery类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testQueryByMember

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public void testQueryByMember() {
  GroupQuery query = identityService.createGroupQuery().groupMember("fozzie");
  verifyQueryResults(query, 2);
  
  query = identityService.createGroupQuery().groupMember("kermit");
  verifyQueryResults(query, 3);
  
  query = query.orderByGroupId().asc();
  List<Group> groups = query.list();
  assertEquals(3, groups.size());
  assertEquals("admin", groups.get(0).getId());
  assertEquals("frogs", groups.get(1).getId());
  assertEquals("muppets", groups.get(2).getId());

  query = query.groupType("user");
  groups = query.list();
  assertEquals(2, groups.size());
  assertEquals("frogs", groups.get(0).getId());
  assertEquals("muppets", groups.get(1).getId());
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:21,代码来源:GroupQueryTest.java

示例2: testQuerySorting

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public void testQuerySorting() {
  // asc
  assertEquals(4, identityService.createGroupQuery().orderByGroupId().asc().count());
  assertEquals(4, identityService.createGroupQuery().orderByGroupName().asc().count());
  assertEquals(4, identityService.createGroupQuery().orderByGroupType().asc().count());

  // desc
  assertEquals(4, identityService.createGroupQuery().orderByGroupId().desc().count());
  assertEquals(4, identityService.createGroupQuery().orderByGroupName().desc().count());
  assertEquals(4, identityService.createGroupQuery().orderByGroupType().desc().count());
  
  // Multiple sortings
  GroupQuery query = identityService.createGroupQuery().orderByGroupType().asc().orderByGroupName().desc();
  List<Group> groups = query.list();
  assertEquals(4, query.count());
  
  assertEquals("security", groups.get(0).getType());
  assertEquals("user", groups.get(1).getType());
  assertEquals("user", groups.get(2).getType());
  assertEquals("user", groups.get(3).getType());

  assertEquals("admin", groups.get(0).getId());
  assertEquals("muppets", groups.get(1).getId());
  assertEquals("mammals", groups.get(2).getId());
  assertEquals("frogs", groups.get(3).getId());
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:GroupQueryTest.java

示例3: findGroups

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
/**
 * 查询群组列表.
 * 
 * @param type
 *            D 部门, P 岗位, G 群组, R 角色, T 表达式分类, E 表达式.
 * @param keyword
 *            过滤名称关键字.
 */
@RequestMapping(value = "/group/find", method = RequestMethod.GET, produces = "application/json")
public List<AssignItemVo> findGroups(String type, String keyword) {

	List<AssignItemVo> voItems = new ArrayList<AssignItemVo>();

	if (type.equals("T")) {

		voItems.add(new AssignItemVo("EXPRESSION", "内部表达式", "T"));
	} else if (type.equals("E")) {

		HashMap<String, String> exprs = assignmenteExpr.getItems();
		for (String key : exprs.keySet()) {
			AssignItemVo assign = new AssignItemVo();
			assign.setValue("${" + key + "}");
			assign.setName(exprs.get(key) + "(" + assign.getValue() + ")");
			assign.setType("T");
			voItems.add(assign);
		}
	} else {

		GroupQuery query = identityService.createGroupQuery().groupType(type);
		if (StringUtils.isNotEmpty(keyword)) {
			query.groupNameLike("%" + keyword + "%");
		}
		List<Group> list = query.list();
		for (Group g : list) {
			voItems.add(new AssignItemVo(g.getId(), g.getName(), g.getType()));
		}
	}

	return voItems;
}
 
开发者ID:KayuraTeam,项目名称:kayura-activiti,代码行数:41,代码来源:IdentityRestResource.java

示例4: groupId

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public GroupQuery groupId(String id) {
  if (id == null) {
    throw new ActivitiException("Provided id is null");
  }
  this.id = id;
  return this;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:8,代码来源:GroupQueryImpl.java

示例5: groupName

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public GroupQuery groupName(String name) {
  if (name == null) {
    throw new ActivitiException("Provided name is null");
  }
  this.name = name;
  return this;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:8,代码来源:GroupQueryImpl.java

示例6: groupNameLike

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public GroupQuery groupNameLike(String nameLike) {
  if (nameLike == null) {
    throw new ActivitiException("Provided nameLike is null");
  }
  this.nameLike = nameLike;
  return this;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:8,代码来源:GroupQueryImpl.java

示例7: groupType

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public GroupQuery groupType(String type) {
  if (type == null) {
    throw new ActivitiException("Provided type is null");
  }
  this.type = type;
  return this;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:8,代码来源:GroupQueryImpl.java

示例8: groupMember

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public GroupQuery groupMember(String userId) {
  if (userId == null) {
    throw new ActivitiException("Provided userId is null");
  }
  this.userId = userId;
  return this;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:8,代码来源:GroupQueryImpl.java

示例9: testQueryByInvalidId

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public void testQueryByInvalidId() {
  GroupQuery query = identityService.createGroupQuery().groupId("invalid");
  verifyQueryResults(query, 0);
  
  try {
    identityService.createGroupQuery().groupId(null).list();
    fail();
  } catch (ActivitiException e) {}
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:10,代码来源:GroupQueryTest.java

示例10: testQueryByName

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public void testQueryByName() {
  GroupQuery query = identityService.createGroupQuery().groupName("Muppet show characters");
  verifyQueryResults(query, 1);
  
  query = identityService.createGroupQuery().groupName("Famous frogs");
  verifyQueryResults(query, 1);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:8,代码来源:GroupQueryTest.java

示例11: testQueryByInvalidName

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public void testQueryByInvalidName() {
  GroupQuery query = identityService.createGroupQuery().groupName("invalid");
  verifyQueryResults(query, 0);
  
  try {
    identityService.createGroupQuery().groupName(null).list();
    fail();
  } catch (ActivitiException e) {}
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:10,代码来源:GroupQueryTest.java

示例12: testQueryByNameLike

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public void testQueryByNameLike() {
  GroupQuery query = identityService.createGroupQuery().groupNameLike("%Famous%");
  verifyQueryResults(query, 2);
  
  query = identityService.createGroupQuery().groupNameLike("Famous%");
  verifyQueryResults(query, 2);
  
  query = identityService.createGroupQuery().groupNameLike("%show%");
  verifyQueryResults(query, 1);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:11,代码来源:GroupQueryTest.java

示例13: testQueryByInvalidNameLike

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public void testQueryByInvalidNameLike() {
  GroupQuery query = identityService.createGroupQuery().groupNameLike("%invalid%");
  verifyQueryResults(query, 0);
  
  try {
    identityService.createGroupQuery().groupNameLike(null).list();
    fail();
  } catch (ActivitiException e) {}
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:10,代码来源:GroupQueryTest.java

示例14: testQueryByType

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public void testQueryByType() {
  GroupQuery query = identityService.createGroupQuery().groupType("user");
  verifyQueryResults(query, 3);
  
  query = identityService.createGroupQuery().groupType("admin");
  verifyQueryResults(query, 0);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:8,代码来源:GroupQueryTest.java

示例15: testQueryByInvalidType

import org.activiti.engine.identity.GroupQuery; //导入依赖的package包/类
public void testQueryByInvalidType() {
  GroupQuery query = identityService.createGroupQuery().groupType("invalid");
  verifyQueryResults(query, 0);
  
  try {
    identityService.createGroupQuery().groupType(null).list();
    fail();
  } catch (ActivitiException e) {}
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:10,代码来源:GroupQueryTest.java


注:本文中的org.activiti.engine.identity.GroupQuery类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。