本文整理汇总了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());
}
示例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());
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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) {}
}
示例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);
}
示例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) {}
}
示例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);
}
示例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) {}
}
示例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);
}
示例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) {}
}