use of org.activiti.engine.identity.Group in project Activiti by Activiti.
the class TaskQueryImpl method getGroupsForCandidateUser.
protected List<String> getGroupsForCandidateUser(String candidateUser) {
// TODO: Discuss about removing this feature? Or document it properly and maybe recommend to not use it
// and explain alternatives
List<Group> groups = Context.getCommandContext().getGroupIdentityManager().findGroupsByUser(candidateUser);
List<String> groupIds = new ArrayList<String>();
for (Group group : groups) {
groupIds.add(group.getId());
}
return groupIds;
}
use of org.activiti.engine.identity.Group in project Activiti by Activiti.
the class TaskServiceTest method testAddCandidateGroupUnexistingTask.
public void testAddCandidateGroupUnexistingTask() {
Group group = identityService.newGroup("group");
identityService.saveGroup(group);
try {
taskService.addCandidateGroup("unexistingTaskId", group.getId());
fail("ActivitiException expected");
} catch (ActivitiObjectNotFoundException ae) {
assertTextPresent("Cannot find task with id unexistingTaskId", ae.getMessage());
assertEquals(Task.class, ae.getObjectClass());
}
identityService.deleteGroup(group.getId());
}
use of org.activiti.engine.identity.Group in project Activiti by Activiti.
the class GroupSelectionQuery method getCurrentGroups.
protected Set<String> getCurrentGroups() {
Set<String> groupIds = new HashSet<String>();
List<Group> currentGroups = identityService.createGroupQuery().groupMember(userId).list();
for (Group group : currentGroups) {
groupIds.add(group.getId());
}
return groupIds;
}
use of org.activiti.engine.identity.Group in project Activiti by Activiti.
the class GroupsForUserQuery method loadItems.
public List<Item> loadItems(int start, int count) {
List<Group> groups = identityService.createGroupQuery().groupMember(userId).orderByGroupType().asc().orderByGroupId().asc().orderByGroupName().asc().list();
List<Item> groupItems = new ArrayList<Item>();
for (Group group : groups) {
groupItems.add(new GroupItem(group));
}
return groupItems;
}
use of org.activiti.engine.identity.Group in project Activiti by Activiti.
the class NewGroupPopupWindow method handleFormSubmit.
protected void handleFormSubmit() {
try {
// create user
// will throw exception in case validation is false
form.commit();
Group group = createGroup();
// close popup and navigate to new group
close();
ExplorerApp.get().getViewManager().showGroupPage(group.getId());
} catch (InvalidValueException e) {
// Do nothing: the Form component will render the errormsgs automatically
setHeight(270, UNITS_PIXELS);
}
}
Aggregations