private ActivationRuleGroup buildRuleGroup(NotificationPreferenceEntity npe, RuleKey key) {
        ActivationRuleGroup ruleGroup = new ActivationRuleGroup();
        for (NotificationFilterEntity nfe : npe.getRules()) {
            Rule rule = new SimpleSpELRule().name(nfe.getSource()).when(nfe.getExpression());
            ruleGroup.addRule(rule);
        }
        notificationsRuleCache.put(key, ruleGroup);
        return ruleGroup;
    }
NotificationRulesService builds and caches {@link NotificationPreferenceEntity} simple rules on filtering notifications.

<p>This enables notification dispatchers to determine whether a given user wants to ignore a particular type or medium of notification.

<p>Rules are cached for a short period to avoid excessive database invocations and frequently rebuilding rulesets.

@author Marc Savy {@literal <marc@blackparrotlabs.io>}
manager/api/rest-impl/src/main/java/io/apiman/manager/api/notifications/NotificationRulesService.java