public void setNotificationRecipientEvaluators( Map<String, NotificationRecipientEvaluator> notificationRecipientEvaluators) { for (Map.Entry<String, NotificationRecipientEvaluator> entry : notificationRecipientEvaluators.entrySet()) { ScriptLanguage scriptLanguage = ScriptLanguage.parse(entry.getKey()); _notificationRecipientEvaluators.put(scriptLanguage, entry.getValue()); } }
@Override public Map<String, ?> evaluate( KaleoNotificationRecipient kaleoNotificationRecipient, ExecutionContext executionContext) throws PortalException { ScriptLanguage scriptLanguage = ScriptLanguage.parse(kaleoNotificationRecipient.getRecipientScriptLanguage()); NotificationRecipientEvaluator notificationRecipientEvaluator = _notificationRecipientEvaluators.get(scriptLanguage); if (notificationRecipientEvaluator == null) { throw new IllegalArgumentException( "No notification recipient evaluator for script language " + scriptLanguage); } return notificationRecipientEvaluator.evaluate(kaleoNotificationRecipient, executionContext); }