private AnswerHeader retrieveCurrentAnswerHeader(Long id) { if (id != null) { return getBusinessObjectService() .findByPrimaryKey(AnswerHeader.class, Collections.singletonMap("id", id)); } return null; }
public void checkForCertifiedByProxy( DevelopmentProposal developmentProposal, ProposalPerson person, boolean recentlyCompleted) { boolean selfCertifyOnly = getParameterService() .getParameterValueAsBoolean( Constants.MODULE_NAMESPACE_PROPOSAL_DEVELOPMENT, Constants.PARAMETER_COMPONENT_DOCUMENT, ProposalDevelopmentConstants.Parameters.KEY_PERSON_CERTIFICATION_SELF_CERTIFY_ONLY); if (selfCertifyOnly) { String proxyId = getGlobalVariableService().getUserSession().getPrincipalId(); if (!StringUtils.equals(person.getPersonId(), proxyId) && recentlyCompleted) { ProposalDevelopmentNotificationContext context = new ProposalDevelopmentNotificationContext( developmentProposal, "106", "Proposal Person Certification Completed"); ((ProposalDevelopmentNotificationRenderer) context.getRenderer()) .setDevelopmentProposal(developmentProposal); KcNotification notification = getKcNotificationService().createNotificationObject(context); NotificationTypeRecipient recipient = new NotificationTypeRecipient(); recipient.setPersonId(person.getPersonId()); getKcNotificationService() .sendNotification(context, notification, Collections.singletonList(recipient)); } } }