RM: Fix up reject notification so it successfully sends email, despite all the record information having been deleted from the node.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@48071 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2013-03-14 08:22:16 +00:00
parent 376dff7857
commit 2b841abaf8

View File

@@ -314,7 +314,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
{
ParameterCheck.mandatory("record", record);
if (canSendRejectEmail(record) == true)
if (canSendRejectEmail(record, recordCreator) == true)
{
String site = siteService.getSite(record).getShortName();
String rejectReason = (String) nodeService.getProperty(record, PROP_RECORD_REJECTION_REASON);
@@ -331,7 +331,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
args.put("rejectDate", rejectDate);
args.put("recordId", recordId);
args.put("recordName", recordName);
NotificationContext notificationContext = new NotificationContext();
notificationContext.setAsyncNotification(true);
notificationContext.setIgnoreNotificationFailure(true);
@@ -349,7 +349,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
*
* @param record rejected record
*/
private boolean canSendRejectEmail(NodeRef record)
private boolean canSendRejectEmail(NodeRef record, String recordCreator)
{
boolean result = true;
@@ -361,7 +361,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
result = false;
logger.warn(msg1 + "the site which should contain the node '" + record.toString() + "'" + msg2);
}
if (StringUtils.isBlank((String) nodeService.getProperty(record, PROP_RECORD_ORIGINATING_USER_ID)) == true)
if (StringUtils.isBlank(recordCreator) == true)
{
result = false;
logger.warn(msg1 + "the user, who created the record" + msg2);