use of org.kuali.kfs.kim.impl.role.RoleMember in project cu-kfs by CU-CommunityApps.
the class OrgReviewRoleServiceImpl method getRoleMemberToSave.
protected RoleMember getRoleMemberToSave(RoleLite role, OrgReviewRole orr) {
RoleMember roleMember = null;
if (orr.getPerson() != null) {
roleMember = new RoleMember();
roleMember.setRoleId(role.getId());
roleMember.setType(MemberType.PRINCIPAL);
roleMember.setMemberId(orr.getPerson().getPrincipalId());
} else if (orr.getGroup() != null) {
roleMember = new RoleMember();
roleMember.setRoleId(role.getId());
roleMember.setType(MemberType.GROUP);
roleMember.setMemberId(orr.getGroup().getId());
} else if (orr.getRole() != null) {
roleMember = new RoleMember();
roleMember.setRoleId(role.getId());
roleMember.setType(MemberType.ROLE);
roleMember.setMemberId(orr.getRole().getId());
}
if (roleMember != null) {
if (orr.isEdit()) {
roleMember.setId(orr.getRoleMemberId());
}
roleMember.setAttributes(getAttributes(orr, role.getKimTypeId()));
if (orr.getActiveFromDate() != null) {
roleMember.setActiveFromDateValue(new Timestamp(orr.getActiveFromDate().getTime()));
}
if (orr.getActiveToDate() != null) {
roleMember.setActiveToDateValue(new Timestamp(orr.getActiveToDate().getTime()));
}
}
return roleMember;
}
use of org.kuali.kfs.kim.impl.role.RoleMember in project cu-kfs by CU-CommunityApps.
the class ResponsibilityInternalServiceImpl method saveRoleMember.
@Override
public RoleMember saveRoleMember(RoleMember roleMember) {
// need to find what responsibilities changed so we can notify interested clients. Like workflow.
List<RoleResponsibility> oldRoleResp = getRoleResponsibilities(roleMember.getRoleId());
// add row to member table
RoleMember member = businessObjectService.save(roleMember);
// need to find what responsibilities changed so we can notify interested clients. Like workflow.
// the new member has been added
List<RoleResponsibility> newRoleResp = getRoleResponsibilities(roleMember.getRoleId());
updateActionRequestsForResponsibilityChange(getChangedRoleResponsibilityIds(oldRoleResp, newRoleResp));
return member;
}
Aggregations