org.activiti.engine.identity.Group类的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(10.0k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中org.activiti.engine.identity.Group类的一些代码示例,展示了Group类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Group类的具体详情如下:
包路径:org.activiti.engine.identity.Group
类名称:Group

Group介绍

[英]Represents a group, used in IdentityService.
[中]表示在IdentityService中使用的组。

代码示例

代码示例来源:origin: bill1012/AdminEAP

@Override
public List<Group> findGroupsByUser(String userId) {
  String sql = "select r.id id,name,code from tbl_role r" +
      " left join tbl_user_role ur on r.id=ur.roleid" +
      " where ur.userid=:userid";
  Map<String, Object> param = new HashMap<>();
  param.put("userid", userId);
  List<Map<String, Object>> maps = super.findMapBySql(sql, param);
  List<Group> groups = new ArrayList<>();
  for (Map<String, Object> map : maps) {
    Group group = new GroupEntity();
    group.setId(map.get("id").toString());
    group.setName(map.get("name").toString());
    group.setType(map.get("code").toString());
    groups.add(group);
  }
  return groups;
}

代码示例来源:origin: org.activiti/activiti-explorer

protected String getGroupName(Group theGroup) {
 if(theGroup.getName() == null) {
  return theGroup.getId();
 }
 return group.getName();
}

代码示例来源:origin: bill1012/AdminEAP

List<String> groupCodeList = new ArrayList<>();
for (Group group : groupList) {
  groupCodeList.add(group.getType());

代码示例来源:origin: org.activiti/activiti-explorer

protected void createGroup(String groupId, String type) {
 if (identityService.createGroupQuery().groupId(groupId).count() == 0) {
  Group newGroup = identityService.newGroup(groupId);
  newGroup.setName(groupId.substring(0, 1).toUpperCase() + groupId.substring(1));
  newGroup.setType(type);
  identityService.saveGroup(newGroup);
 }
}

代码示例来源:origin: org.activiti/activiti-explorer

public GroupSelectionItem(Group group) {
 addItemProperty("id", new ObjectProperty<String>(group.getId(), String.class));
 if (group.getName() != null) {
  addItemProperty("name", new ObjectProperty<String>(group.getName(), String.class));
 }
 if (group.getType() != null) {
  addItemProperty("type", new ObjectProperty<String>(group.getType(), String.class));
 }
}

代码示例来源:origin: org.activiti/activiti-explorer

public void toolBarItemSelected() {
  viewManager.showQueuedPage(group.getId());
 }
});

代码示例来源:origin: org.activiti/activiti-explorer

public void buttonClick(ClickEvent event) {
  String originalName = group.getName();
  
  // Update data
  if (nameTextField.getValue() != null) {
  group.setName(nameTextField.getValue().toString());
  group.setType(typeCombobox.getValue().toString());
  }
  identityService.saveGroup(group);
  
  // Update UI
  editingDetails = false;
  detailLayout.removeAllComponents();
  populateGroupDetails();
  
  // Refresh task list (only if name was changed)
  if ( (originalName != null && !originalName.equals(group.getName())) 
      || (originalName == null && group.getName() != null)) {
   groupPage.notifyGroupChanged(group.getId());
  }
 }
});

代码示例来源:origin: org.activiti/activiti-rest

@ApiOperation(value = "Update a group", tags = {"Groups"},
  notes = "All request values are optional. For example, you can only include the name attribute in the request body JSON-object, only updating the name of the group, leaving all other fields unaffected. When an attribute is explicitly included and is set to null, the group-value will be updated to null.")
@ApiResponses(value = {
  @ApiResponse(code = 201, message = "Indicates the group was updated."),
  @ApiResponse(code = 404, message = "Indicates the requested group was not found."),
  @ApiResponse(code = 409, message = "Indicates the requested group was updated simultaneously.")
})
@RequestMapping(value = "/identity/groups/{groupId}", method = RequestMethod.PUT, produces = "application/json")
public GroupResponse updateGroup(@ApiParam(name="groupId") @PathVariable String groupId, @RequestBody GroupRequest groupRequest, HttpServletRequest request) {
 Group group = getGroupFromRequest(groupId);
 if (groupRequest.getId() == null || groupRequest.getId().equals(group.getId())) {
  if (groupRequest.isNameChanged()) {
   group.setName(groupRequest.getName());
  }
  if (groupRequest.isTypeChanged()) {
   group.setType(groupRequest.getType());
  }
  identityService.saveGroup(group);
 } else {
  throw new ActivitiIllegalArgumentException("Key provided in request body doesn't match the key in the resource URL.");
 }
 return restResponseFactory.createGroupResponse(group);
}

代码示例来源:origin: org.activiti/activiti-explorer

for (Group group : groups) {
 if (Constants.SECURITY_ROLE.equals(group.getType())) {
  loggedInUser.addSecurityRoleGroup(group);
  if (Constants.SECURITY_ROLE_USER.equals(group.getId())) {
   loggedInUser.setUser(true);
  if (Constants.SECURITY_ROLE_ADMIN.equals(group.getId())) {
   loggedInUser.setAdmin(true);
       && ExplorerApp.get().getAdminGroups().contains(group.getId())) {
  loggedInUser.addSecurityRoleGroup(group);
  loggedInUser.setAdmin(true);
 } else if (ExplorerApp.get().getUserGroups() != null
     && ExplorerApp.get().getUserGroups().contains(group.getId())) {
  loggedInUser.addSecurityRoleGroup(group);
  loggedInUser.setUser(true);

代码示例来源:origin: bluejoe2008/openwebflow

public Group createGroup(String groupId, String groupName)
{
  Group group = _groups.get(groupId);
  if (group == null)
  {
    group = new GroupEntity(groupId);
    _groups.put(groupId, group);
  }
  if (groupName != null)
  {
    group.setName(groupName);
  }
  return group;
}

代码示例来源:origin: ldlqdsdcn/eidea4

private void setTaskGroup(Map<String, Object> vars, Set<Expression> candidateGroupIdExpressions) {
  String roles = "";
  for (Expression expression : candidateGroupIdExpressions) {
    String expressionText = expression.getExpressionText();
    String roleName = identityService.createGroupQuery().groupId(expressionText).singleResult().getName();
    roles += roleName;
  }
  vars.put("任务所属角色", roles);
}
/**

代码示例来源:origin: com.github.hongframework/hframe-workflow

protected void createGroup(String groupId, String type) {
 if (identityService.createGroupQuery().groupId(groupId).count() == 0) {
  Group newGroup = identityService.newGroup(groupId);
  newGroup.setName(groupId.substring(0, 1).toUpperCase() + groupId.substring(1));
  newGroup.setType(type);
  identityService.saveGroup(newGroup);
 }
}

代码示例来源:origin: org.activiti/activiti-rest

public GroupResponse createGroupResponse(Group group, RestUrlBuilder urlBuilder) {
 GroupResponse response = new GroupResponse();
 response.setId(group.getId());
 response.setName(group.getName());
 response.setType(group.getType());
 response.setUrl(urlBuilder.buildUrl(RestUrls.URL_GROUP, group.getId()));
 return response;
}

代码示例来源:origin: org.ow2.petals/petals-se-activiti

@Override
public List<User> meetCriteria(final List<User> users) {
  final List<User> usersOfGroup = new ArrayList<User>();
  for (final User user : users) {
    final List<Group> groupsOfUser = this.groupsByUser.get(user.getId());
    for (final Group groupOfUser : groupsOfUser) {
      if (groupOfUser != null && this.expectedGroupId.equals(groupOfUser.getId())) {
        usersOfGroup.add(user);
        break;
      }
    }
  }
  return usersOfGroup;
}

代码示例来源:origin: axemblr/axemblr-provisionr

@Override
protected Object doExecute() throws Exception {
  IdentityService identityService = getProcessEngine().getIdentityService();
  Group group = identityService.newGroup(id);
  group.setName(name);
  group.setType(type);
  identityService.saveGroup(group);
  return null;
}

代码示例来源:origin: org.apache.provisionr/activiti-karaf-commands

@Override
  protected Object doExecute() throws Exception {
    List<Group> groups = getProcessEngine().getIdentityService()
      .createGroupQuery().orderByGroupId().asc().list();

    if (groups.isEmpty()) {
      err().println("No groups found.");
    }
    for (Group group : groups) {
      out().printf("%s\t%s\t%s\n", group.getId(), group.getName(), group.getType());
    }
    return null;
  }
}

代码示例来源:origin: org.activiti/activiti-rest

@ApiOperation(value = "Delete a group", tags = {"Groups"})
 @ApiResponses(value = {
   @ApiResponse(code = 204, message = "Indicates the group was found and  has been deleted. Response-body is intentionally empty."),
   @ApiResponse(code = 404, message = "Indicates the requested group does not exist.")
 })
 @RequestMapping(value = "/identity/groups/{groupId}", method = RequestMethod.DELETE)
 public void deleteGroup(@ApiParam(name="groupId", value="The id of the group to delete.") @PathVariable String groupId, HttpServletResponse response) {
  Group group = getGroupFromRequest(groupId);
  identityService.deleteGroup(group.getId());
  response.setStatus(HttpStatus.NO_CONTENT.value());
 }
}

代码示例来源:origin: org.activiti/activiti-rest

@ApiOperation(value = "Create a group", tags = {"Groups"})
@ApiResponses(value = {
  @ApiResponse(code = 201, message = "Indicates the group was created."),
  @ApiResponse(code = 400, message = "Indicates the id of the group was missing.")
})
@RequestMapping(value = "/identity/groups", method = RequestMethod.POST, produces = "application/json")
public GroupResponse createGroup(@RequestBody GroupRequest groupRequest, HttpServletRequest httpRequest, HttpServletResponse response) {
 if (groupRequest.getId() == null) {
  throw new ActivitiIllegalArgumentException("Id cannot be null.");
 }
 // Check if a user with the given ID already exists so we return a
 // CONFLICT
 if (identityService.createGroupQuery().groupId(groupRequest.getId()).count() > 0) {
  throw new ActivitiConflictException("A group with id '" + groupRequest.getId() + "' already exists.");
 }
 Group created = identityService.newGroup(groupRequest.getId());
 created.setId(groupRequest.getId());
 created.setName(groupRequest.getName());
 created.setType(groupRequest.getType());
 identityService.saveGroup(created);
 response.setStatus(HttpStatus.CREATED.value());
 return restResponseFactory.createGroupResponse(created);
}

代码示例来源:origin: org.activiti/activiti-explorer

public GroupListItem(Group group) {
 addItemProperty("id", new ObjectProperty<String>(group.getId(), String.class));
 if (group.getName() != null) {
  addItemProperty("name", new ObjectProperty<String>(group.getName()
      + " (" + group.getName() + ")", String.class));
 } else {
  addItemProperty("name", new ObjectProperty<String>("(" + group.getId() + ")", String.class));
 }
}

代码示例来源:origin: org.apache.provisionr/activiti-karaf-commands

@Override
protected Object doExecute() throws Exception {
  IdentityService identityService = getProcessEngine().getIdentityService();
  Group group = identityService.newGroup(id);
  group.setName(name);
  group.setType(type);
  identityService.saveGroup(group);
  return null;
}

相关文章

微信公众号

最新文章

更多