org.kuali.rice.kns.service.impl
Class KualiRuleServiceImpl

java.lang.Object
  extended by org.kuali.rice.kns.service.impl.KualiRuleServiceImpl
All Implemented Interfaces:
KualiRuleService

public class KualiRuleServiceImpl
extends Object
implements KualiRuleService

This class 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.


Field Summary
private  DataDictionaryService dataDictionaryService
           
private  DictionaryValidationService dictionaryValidationService
           
private static org.apache.log4j.Logger LOG
           
private  MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService
           
private  TransactionalDocumentDictionaryService transactionalDocumentDictionaryService
           
 
Constructor Summary
KualiRuleServiceImpl()
           
 
Method Summary
 boolean applyRules(KualiDocumentEvent event)
          Retrieves and instantiates the businessRulesClass associated with the event's document type (if any), and calls the appropriate process* method of that businessRule for handling the given event type.
private  void decreaseErrorPath(String errorPathPrefix)
          This method decreases the registered error path, so that field highlighting can occur on the appropriate object attribute.
 List generateAdHocRoutePersonEvents(Document document)
          Builds a list containing AddAdHocRoutePersonEvents since the validation done for an AdHocRouteRecipient is the same for all events.
 List generateAdHocRouteWorkgroupEvents(Document document)
          Builds a list containing AddAdHocRoutePersonEvents since the validation done for an AdHocRouteRecipient is the same for all events.
 BusinessRule getBusinessRulesInstance(Document document, Class ruleInterface)
          Allows code in actions or business objects to directly access rule methods in the class.
 DataDictionaryService getDataDictionaryService()
           
 DictionaryValidationService getDictionaryValidationService()
           
 MaintenanceDocumentDictionaryService getMaintenanceDocumentDictionaryService()
           
 TransactionalDocumentDictionaryService getTransactionalDocumentDictionaryService()
           
private  void increaseErrorPath(String errorPathPrefix)
          This method increases the registered error path, so that field highlighting can occur on the appropriate object attribute.
 void setDataDictionaryService(DataDictionaryService dataDictionaryService)
           
 void setDictionaryValidationService(DictionaryValidationService dictionaryValidationService)
           
 void setMaintenanceDocumentDictionaryService(MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService)
           
 void setTransactionalDocumentDictionaryService(TransactionalDocumentDictionaryService transactionalDocumentDictionaryService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG

transactionalDocumentDictionaryService

private TransactionalDocumentDictionaryService transactionalDocumentDictionaryService

maintenanceDocumentDictionaryService

private MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService

dictionaryValidationService

private DictionaryValidationService dictionaryValidationService

dataDictionaryService

private DataDictionaryService dataDictionaryService
Constructor Detail

KualiRuleServiceImpl

public KualiRuleServiceImpl()
Method Detail

applyRules

public boolean applyRules(KualiDocumentEvent event)
Description copied from interface: KualiRuleService
Retrieves and instantiates the businessRulesClass associated with the event's document type (if any), and calls the appropriate process* method of that businessRule for handling the given event type. This is a helper method that takes in the generic KualiDocumentEvent class and determines which event call to make.

Specified by:
applyRules in interface KualiRuleService
Returns:
true if no rule is applied, or all rules are applied successfully, false otherwise
See Also:
KualiRuleService.applyRules(org.kuali.rice.kns.rule.event.KualiDocumentEvent)

generateAdHocRoutePersonEvents

public List generateAdHocRoutePersonEvents(Document document)
Builds a list containing AddAdHocRoutePersonEvents since the validation done for an AdHocRouteRecipient is the same for all events.

Specified by:
generateAdHocRoutePersonEvents in interface KualiRuleService
Returns:
List
See Also:
KualiRuleService.generateAdHocRoutePersonEvents(org.kuali.rice.kns.document.Document)

generateAdHocRouteWorkgroupEvents

public List generateAdHocRouteWorkgroupEvents(Document document)
Builds a list containing AddAdHocRoutePersonEvents since the validation done for an AdHocRouteRecipient is the same for all events.

Specified by:
generateAdHocRouteWorkgroupEvents in interface KualiRuleService
Returns:
List
See Also:
KualiRuleService.generateAdHocRouteWorkgroupEvents(org.kuali.rice.kns.document.Document)

getBusinessRulesInstance

public BusinessRule getBusinessRulesInstance(Document document,
                                             Class ruleInterface)
Description copied from interface: KualiRuleService
Allows code in actions or business objects to directly access rule methods in the class.

Specified by:
getBusinessRulesInstance in interface KualiRuleService
Parameters:
document -
ruleInterface -
Returns:
instance of the businessRulesClass for the given document's type, if that businessRulesClass implements the given ruleInterface

increaseErrorPath

private void increaseErrorPath(String errorPathPrefix)
This method increases the registered error path, so that field highlighting can occur on the appropriate object attribute.

Parameters:
errorPathPrefix -

decreaseErrorPath

private void decreaseErrorPath(String errorPathPrefix)
This method decreases the registered error path, so that field highlighting can occur on the appropriate object attribute.

Parameters:
errorPathPrefix -

setMaintenanceDocumentDictionaryService

public void setMaintenanceDocumentDictionaryService(MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService)
Parameters:
maintenanceDocumentDictionaryService -

getMaintenanceDocumentDictionaryService

public MaintenanceDocumentDictionaryService getMaintenanceDocumentDictionaryService()
Returns:
MaintenanceDocumentDictionaryService

setTransactionalDocumentDictionaryService

public void setTransactionalDocumentDictionaryService(TransactionalDocumentDictionaryService transactionalDocumentDictionaryService)
Parameters:
transactionalDocumentDictionaryService -

getTransactionalDocumentDictionaryService

public TransactionalDocumentDictionaryService getTransactionalDocumentDictionaryService()
Returns:
TransactionalDocumentDictionaryService

getDictionaryValidationService

public DictionaryValidationService getDictionaryValidationService()
Returns:
DictionaryValidationService

setDictionaryValidationService

public void setDictionaryValidationService(DictionaryValidationService dictionaryValidationService)
Parameters:
dictionaryValidationService -

getDataDictionaryService

public DataDictionaryService getDataDictionaryService()
Returns:
DataDictionaryService

setDataDictionaryService

public void setDataDictionaryService(DataDictionaryService dataDictionaryService)
Parameters:
dataDictionaryService -


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.