Package org.kuali.rice.krad.service.impl
Class KualiRuleServiceImpl
java.lang.Object
org.kuali.rice.krad.service.impl.KualiRuleServiceImpl
- All Implemented Interfaces:
org.kuali.rice.krad.service.KualiRuleService
public class KualiRuleServiceImpl
extends Object
implements org.kuali.rice.krad.service.KualiRuleService
Represents a rule evaluator for Kuali. This class is to be used for evaluating business rule checks. The class
defines one method right now - applyRules() which takes in a Document and a DocumentEvent and does the proper
business rule checks based on the context of the event and the document type
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyRules(org.kuali.rice.krad.rules.rule.event.DocumentEvent event) List<org.kuali.rice.krad.rules.rule.event.AddAdHocRoutePersonEvent> generateAdHocRoutePersonEvents(org.kuali.rice.krad.document.Document document) Builds a list containing AddAdHocRoutePersonEvents since the validation done for an AdHocRouteRecipient is the same for all eventsList<org.kuali.rice.krad.rules.rule.event.AddAdHocRouteWorkgroupEvent> generateAdHocRouteWorkgroupEvents(org.kuali.rice.krad.document.Document document) Builds a list containing AddAdHocRoutePersonEvents since the validation done for an AdHocRouteRecipient is the same for all eventsorg.kuali.rice.krad.rules.rule.BusinessRulegetBusinessRulesInstance(org.kuali.rice.krad.document.Document document, Class<? extends org.kuali.rice.krad.rules.rule.BusinessRule> ruleInterface) org.kuali.rice.krad.service.DataDictionaryServiceorg.kuali.rice.krad.service.DocumentDictionaryServicebooleaninvokeBusinessRuleMethod(org.kuali.rice.krad.rules.rule.BusinessRule rule, org.kuali.rice.krad.rules.rule.event.DocumentEvent event) local helper method to invoke the business rule methodvoidsetDataDictionaryService(org.kuali.rice.krad.service.DataDictionaryService dataDictionaryService) voidsetDocumentDictionaryService(org.kuali.rice.krad.service.DocumentDictionaryService documentDictionaryService)
-
Constructor Details
-
KualiRuleServiceImpl
public KualiRuleServiceImpl()
-
-
Method Details
-
applyRules
public boolean applyRules(org.kuali.rice.krad.rules.rule.event.DocumentEvent event) - Specified by:
applyRulesin interfaceorg.kuali.rice.krad.service.KualiRuleService- See Also:
-
invokeBusinessRuleMethod
public boolean invokeBusinessRuleMethod(org.kuali.rice.krad.rules.rule.BusinessRule rule, org.kuali.rice.krad.rules.rule.event.DocumentEvent event) local helper method to invoke the business rule method- Parameters:
rule- the business rule class that the method to invoke belongs toevent- the document event the rule applies to- Returns:
- a boolean to indicate whether the method invocation was a succes or not
-
generateAdHocRoutePersonEvents
public List<org.kuali.rice.krad.rules.rule.event.AddAdHocRoutePersonEvent> generateAdHocRoutePersonEvents(org.kuali.rice.krad.document.Document document) Builds a list containing AddAdHocRoutePersonEvents since the validation done for an AdHocRouteRecipient is the same for all events- Specified by:
generateAdHocRoutePersonEventsin interfaceorg.kuali.rice.krad.service.KualiRuleService- See Also:
-
generateAdHocRouteWorkgroupEvents
public List<org.kuali.rice.krad.rules.rule.event.AddAdHocRouteWorkgroupEvent> generateAdHocRouteWorkgroupEvents(org.kuali.rice.krad.document.Document document) Builds a list containing AddAdHocRoutePersonEvents since the validation done for an AdHocRouteRecipient is the same for all events- Specified by:
generateAdHocRouteWorkgroupEventsin interfaceorg.kuali.rice.krad.service.KualiRuleService- See Also:
-
getBusinessRulesInstance
public org.kuali.rice.krad.rules.rule.BusinessRule getBusinessRulesInstance(org.kuali.rice.krad.document.Document document, Class<? extends org.kuali.rice.krad.rules.rule.BusinessRule> ruleInterface) - Specified by:
getBusinessRulesInstancein interfaceorg.kuali.rice.krad.service.KualiRuleService- Parameters:
document-ruleInterface-- Returns:
- instance of the businessRulesClass for the given document's type, if that businessRulesClass implements the given ruleInterface
-
getDocumentDictionaryService
public org.kuali.rice.krad.service.DocumentDictionaryService getDocumentDictionaryService() -
setDocumentDictionaryService
public void setDocumentDictionaryService(org.kuali.rice.krad.service.DocumentDictionaryService documentDictionaryService) -
getDataDictionaryService
public org.kuali.rice.krad.service.DataDictionaryService getDataDictionaryService() -
setDataDictionaryService
public void setDataDictionaryService(org.kuali.rice.krad.service.DataDictionaryService dataDictionaryService)
-