RM-3651: workaround to skip code execution when first element is not a

record
This commit is contained in:
Silviu Dinuta
2016-07-11 18:26:46 +03:00
parent d9f9372da3
commit 2e1cc03bf4

View File

@@ -243,6 +243,8 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
{
ParameterCheck.mandatory("records", records);
if (!records.isEmpty())
{
if (nodeService.hasAspect(records.get(0), RecordsManagementModel.ASPECT_RECORD))
{
NodeRef root = getRMRoot(records.get(0));
String groupName = getGroupName(root);
@@ -256,7 +258,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
notificationContext.setBodyTemplate(getDueForReviewTemplate().toString());
Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f);
args.put("records", (Serializable)records);
args.put("records", (Serializable) records);
args.put("site", getSiteName(root));
notificationContext.setTemplateArgs(args);
@@ -271,7 +273,9 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
logger.warn("Unable to send record due for review email notification, because notification group was empty.");
}
throw new AlfrescoRuntimeException("Unable to send record due for review email notification, because notification group was empty.");
throw new AlfrescoRuntimeException(
"Unable to send record due for review email notification, because notification group was empty.");
}
}
}
}