public ActionForward addResponsibility( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { IdentityManagementRoleDocumentForm roleDocumentForm = (IdentityManagementRoleDocumentForm) form; KimDocumentRoleResponsibility newResponsibility = roleDocumentForm.getResponsibility(); if (newResponsibility != null && StringUtils.isNotBlank(newResponsibility.getResponsibilityId())) { ResponsibilityBo responsibilityImpl = KradDataServiceLocator.getDataObjectService() .find(ResponsibilityBo.class, newResponsibility.getResponsibilityId()); newResponsibility.setKimResponsibility(responsibilityImpl); } if (KRADServiceLocatorWeb.getKualiRuleService() .applyRules( new AddResponsibilityEvent( "", roleDocumentForm.getRoleDocument(), newResponsibility))) { if (newResponsibility != null) { newResponsibility.setDocumentNumber(roleDocumentForm.getDocument().getDocumentNumber()); } roleDocumentForm.getRoleDocument().addResponsibility(newResponsibility); roleDocumentForm.setResponsibility(new KimDocumentRoleResponsibility()); roleDocumentForm.getRoleDocument().updateMembers(newResponsibility); } return mapping.findForward(RiceConstants.MAPPING_BASIC); }
/** * Converts a immutable object to its mutable counterpart * * @param im immutable object * @return the mutable bo */ public static NotificationRecipientBo from(NotificationRecipient im) { if (im == null) { return null; } NotificationRecipientBo bo = new NotificationRecipientBo(); bo.setId(im.getId()); bo.setVersionNumber(im.getVersionNumber()); bo.setObjectId(im.getObjectId()); bo.setRecipientType(im.getRecipientType()); bo.setRecipientId(im.getRecipientId()); if (im.getNotificationId() != null) { NotificationBo notification = KradDataServiceLocator.getDataObjectService() .find(NotificationBo.class, im.getNotificationId()); bo.setNotification(notification); } return bo; }