}
public void createMembership(String userId, String groupId, String role) {
User user = findUserById(userId);
if (user == null) {
throw new JbpmException("user " + userId + " doesn't exist");
}
Group group = findGroupById(groupId);
if (group == null) {
throw new JbpmException("group " + groupId + " doesn't exist");
}
MembershipImpl membership = new MembershipImpl();
membership.setUser(user);
membership.setGroup(group);