Package org.jbpm.api

Examples of org.jbpm.api.JbpmException


      users.add(findUserById(iduser.getId()));
    }
   
    return users;
  } catch (IdentityException e) {
    throw new JbpmException("couldn't find users by groupid: " + groupId, e);
  } catch (FeatureNotSupportedException e) {
    throw new JbpmException("couldn't find users by groupid: " + groupId, e);
  }
   
  }
View Full Code Here


  public void deleteUser(String userName) {
    try {     
      identitySession.getPersistenceManager().removeUser(userName, true);   
    } catch (IdentityException e) {
      throw new JbpmException("couldn't delete user ["+userName + "]", e);
    }
  }
View Full Code Here

      String groupId = group.getId();
     
      if (parentGroupId!=null) {
        org.jboss.identity.idm.api.Group parentGroup = findIdmGroupByIdmGroupId(convertjbpmGroupId2IdmGroupId(parentGroupId));
        if (parentGroup==null) {
          throw new JbpmException("parent group "+parentGroupId+" doesn't exist");
        }
        identitySession.getRelationshipManager().associateGroups(parentGroup, group);
      }
     return convertIdmGroupId2jbpmGroupId(groupId);
    
    } catch (IdentityException e) {
      throw new JbpmException("couldn't create group "+groupName, e);
    }
   
  }
View Full Code Here

    }
   
    return group;
   
  } catch (IdentityException e) {
    throw new JbpmException("couldn't find group by id [" + groupId + "]", e);
 
  }
View Full Code Here

      }
     
      return groups;
     
    } catch (IdentityException e) {
      throw new JbpmException("couldn't get groups from identity component, groupType [" + groupType + "]", e);
    }
  }
View Full Code Here

    for (org.jboss.identity.idm.api.Group idGroup : idGroups) {
      groups.add(findGroupById(convertIdmGroupId2jbpmGroupId(idGroup.getId())));
    }
    return groups;
  } catch (Exception e) {
    throw new JbpmException("Couldn't get Groups by userId [" + userId + "]", e);
   
  }
  }
View Full Code Here

      for (org.jboss.identity.idm.api.Group idGroup : idGroups) {
        groups.add(findGroupById(convertIdmGroupId2jbpmGroupId(idGroup.getId())));
      }
      return groups;
    } catch (Exception e) {
      throw new JbpmException("couldn't get groups for user "+userName+" and groupType "+groupType, e);
    }
  }
View Full Code Here

      }

      identitySession.getPersistenceManager().removeGroup(group, true);
   
    } catch (IdentityException e) {
      throw new JbpmException("couldn't delete group "+groupId, e);
    }
  }
View Full Code Here

  public void createMembership(String userId, String groupId, String role) {
    try {
      org.jboss.identity.idm.api.Group group = findIdmGroupByIdmGroupId(convertjbpmGroupId2IdmGroupId(groupId));
      if (group==null) {
        throw new JbpmException("group "+groupId+" doesn't exist");
      }
 
      org.jboss.identity.idm.api.User idUser = identitySession.getPersistenceManager().findUser(userId);
      if (idUser==null) {
        throw new JbpmException("user "+userId+" doesn't exist");
      }
     
      if (role == null) {
        role = DEFAULT_JBPM_MEMBER_ROLE;
      }
    RoleType roleType = identitySession.getRoleManager().getRoleType(role);
    System.out.println("The Role Type is: " + roleType);
    if (roleType == null) {
      roleType = identitySession.getRoleManager().createRoleType(role);
    }
      identitySession.getRoleManager().createRole(roleType, idUser, group);
     
    } catch (Exception e) {
      throw new JbpmException("couldn't create membership "+userId+", "+groupId+", "+role, e);
    }
  }
View Full Code Here

  public void deleteMembership(String userId, String groupId, String role) {
  try {
    RoleType rtype = identitySession.getRoleManager().getRoleType(role);
    identitySession.getRoleManager().removeRole(rtype.getName(), userId, convertjbpmGroupId2IdmGroupId(groupId));
  } catch (Exception e) {
    throw new JbpmException("couldn't delete the membership [" + userId + "," + groupId + "," + role + "]", e);
 
 
  }
View Full Code Here

TOP

Related Classes of org.jbpm.api.JbpmException

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.