org.kuali.rice.kew.rule.service
Interface RuleService

All Superinterfaces:
XmlExporter, XmlLoader
All Known Implementing Classes:
RuleServiceImpl

public interface RuleService
extends XmlLoader, XmlExporter

A service which provides data access and functions for the KEW Rules engine.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
RuleBaseValues, RuleResponsibility

Method Summary
 void delete(Long ruleBaseValuesId)
           
 void deleteRuleResponsibilityById(Long ruleResponsibilityId)
           
 List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType)
           
 List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType, boolean ignoreCache)
           
 List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType, Timestamp effectiveDate)
           
 List fetchAllRules(boolean currentRules)
           
 List findByRouteHeaderId(Long routeHeaderId)
           
 RuleResponsibility findByRuleResponsibilityId(Long ruleResponsibilityId)
           
 RuleBaseValues findDefaultRuleByRuleTemplateId(Long ruleTemplateId)
           
 Long findResponsibilityIdForRule(String ruleName, String ruleResponsibilityName, String ruleResponsibilityType)
           
 RuleBaseValues findRuleBaseValuesById(Long ruleBaseValuesId)
           
 List findRuleBaseValuesByResponsibilityReviewer(String reviewerName, String type)
           
 List findRuleBaseValuesByResponsibilityReviewerTemplateDoc(String ruleTemplateName, String documentType, String reviewerName, String type)
           
 RuleResponsibility findRuleResponsibility(Long responsibilityId)
           
 void flushRuleCache()
           
 Long getDuplicateRuleId(RuleBaseValues rule)
          Checks if the Rule with the given value is a duplicate of an existing rule in the system.
 RuleBaseValues getParentRule(Long ruleBaseValuesId)
           
 RuleBaseValues getRuleByName(String name)
          Returns a Rule based on unique name.
 String getRuleDocmentTypeName(List rules)
          Returns the name of the document type definition that should be used to route the given List of rules.
 Long isLockedForRouting(Long currentRuleBaseValuesId)
           
 void makeCurrent(Long routeHeaderId)
           
 void makeCurrent(RuleBaseValues rule, boolean isRetroactiveUpdatePermitted)
           
 void makeCurrent(RuleDelegation ruleDelegation, boolean isRetroactiveUpdatePermitted)
           
 void notifyCacheOfDocumentTypeChange(DocumentType documentType)
          Notifies the Rule system that the given DocumentType has been changed.
 void notifyCacheOfRuleChange(RuleBaseValues rule, DocumentType documentType)
           
 void removeRuleInvolvement(Id entityToBeRemoved, List<Long> ruleIds, Long documentId)
          Removes entities who have responsibilities on the given set of rules.
 void replaceRuleInvolvement(Id entityToBeReplaced, Id newEntity, List<Long> ruleIds, Long documentId)
          Replaces entities who have responsibilities on the given set of rules with the specified new entity.
 Long route2(Long routeHeaderId, MyRules2 myRules, KimPrincipal principal, String annotation, boolean blanketApprove)
           
 Long routeRuleWithDelegate(Long routeHeaderId, RuleBaseValues parentRule, RuleBaseValues delegateRule, KimPrincipal principal, String annotation, boolean blanketApprove)
           
 void save2(RuleBaseValues ruleBaseValues)
           
 RuleBaseValues saveRule(RuleBaseValues rule, boolean isRetroactiveUpdatePermitted)
           
 RuleDelegation saveRuleDelegation(RuleDelegation ruleDelegation, boolean isRetroactiveUpdatePermitted)
           
 List<RuleDelegation> saveRuleDelegations(List<RuleDelegation> ruleDelegationsToSave, boolean isRetroactiveUpdatePermitted)
           
 List<RuleBaseValues> saveRules(List<RuleBaseValues> rulesToSave, boolean isRetroactiveUpdatePermitted)
           
 List search(String docTypeName, Long ruleId, Long ruleTemplateId, String ruleDescription, String groupId, String principalId, Boolean delegateRule, Boolean activeInd, Map extensionValues, String workflowIdDirective)
           
 List search(String docTypeName, String ruleTemplateName, String ruleDescription, String groupId, String principalId, Boolean workgroupMember, Boolean delegateRule, Boolean activeInd, Map extensionValues, Collection<String> actionRequestCodes)
           
 void validate2(RuleBaseValues ruleBaseValues, RuleDelegation ruleDelegation, List errors)
           
 
Methods inherited from interface org.kuali.rice.kew.xml.XmlLoader
loadXml
 
Methods inherited from interface org.kuali.rice.kew.xml.export.XmlExporter
export
 

Method Detail

getRuleByName

RuleBaseValues getRuleByName(String name)
Returns a Rule based on unique name. Returns null if name is null.

Parameters:
name - the rule name
Returns:
the Rule if found, null if not found or null name

route2

Long route2(Long routeHeaderId,
            MyRules2 myRules,
            KimPrincipal principal,
            String annotation,
            boolean blanketApprove)
            throws Exception
Throws:
Exception

routeRuleWithDelegate

Long routeRuleWithDelegate(Long routeHeaderId,
                           RuleBaseValues parentRule,
                           RuleBaseValues delegateRule,
                           KimPrincipal principal,
                           String annotation,
                           boolean blanketApprove)
                           throws Exception
Throws:
Exception

save2

void save2(RuleBaseValues ruleBaseValues)
           throws Exception
Throws:
Exception

validate2

void validate2(RuleBaseValues ruleBaseValues,
               RuleDelegation ruleDelegation,
               List errors)
               throws Exception
Throws:
Exception

delete

void delete(Long ruleBaseValuesId)

findRuleBaseValuesById

RuleBaseValues findRuleBaseValuesById(Long ruleBaseValuesId)

search

List search(String docTypeName,
            Long ruleId,
            Long ruleTemplateId,
            String ruleDescription,
            String groupId,
            String principalId,
            Boolean delegateRule,
            Boolean activeInd,
            Map extensionValues,
            String workflowIdDirective)

search

List search(String docTypeName,
            String ruleTemplateName,
            String ruleDescription,
            String groupId,
            String principalId,
            Boolean workgroupMember,
            Boolean delegateRule,
            Boolean activeInd,
            Map extensionValues,
            Collection<String> actionRequestCodes)

findRuleResponsibility

RuleResponsibility findRuleResponsibility(Long responsibilityId)

deleteRuleResponsibilityById

void deleteRuleResponsibilityById(Long ruleResponsibilityId)

findByRuleResponsibilityId

RuleResponsibility findByRuleResponsibilityId(Long ruleResponsibilityId)

fetchAllCurrentRulesForTemplateDocCombination

List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName,
                                                   String documentType)

fetchAllCurrentRulesForTemplateDocCombination

List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName,
                                                   String documentType,
                                                   boolean ignoreCache)

fetchAllCurrentRulesForTemplateDocCombination

List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName,
                                                   String documentType,
                                                   Timestamp effectiveDate)

findByRouteHeaderId

List findByRouteHeaderId(Long routeHeaderId)

makeCurrent

void makeCurrent(Long routeHeaderId)

makeCurrent

void makeCurrent(RuleBaseValues rule,
                 boolean isRetroactiveUpdatePermitted)

makeCurrent

void makeCurrent(RuleDelegation ruleDelegation,
                 boolean isRetroactiveUpdatePermitted)

findRuleBaseValuesByResponsibilityReviewer

List findRuleBaseValuesByResponsibilityReviewer(String reviewerName,
                                                String type)

findRuleBaseValuesByResponsibilityReviewerTemplateDoc

List findRuleBaseValuesByResponsibilityReviewerTemplateDoc(String ruleTemplateName,
                                                           String documentType,
                                                           String reviewerName,
                                                           String type)

isLockedForRouting

Long isLockedForRouting(Long currentRuleBaseValuesId)

fetchAllRules

List fetchAllRules(boolean currentRules)

findDefaultRuleByRuleTemplateId

RuleBaseValues findDefaultRuleByRuleTemplateId(Long ruleTemplateId)

notifyCacheOfRuleChange

void notifyCacheOfRuleChange(RuleBaseValues rule,
                             DocumentType documentType)

getParentRule

RuleBaseValues getParentRule(Long ruleBaseValuesId)

notifyCacheOfDocumentTypeChange

void notifyCacheOfDocumentTypeChange(DocumentType documentType)
Notifies the Rule system that the given DocumentType has been changed. When a DocumentType changes this could result in the change to the DocumentType hierarchy. In these cases we want to ensure that all Rules within that DocumentType hierarchy get flushed from the cache so they can be re-cached with the proper DocumentType hierarchy in place.


flushRuleCache

void flushRuleCache()

getRuleDocmentTypeName

String getRuleDocmentTypeName(List rules)
Returns the name of the document type definition that should be used to route the given List of rules. This method will never return a null value, as it will default to the default Rule document type name if not custom document type is configured for the given rules.


replaceRuleInvolvement

void replaceRuleInvolvement(Id entityToBeReplaced,
                            Id newEntity,
                            List<Long> ruleIds,
                            Long documentId)
                            throws WorkflowException
Replaces entities who have responsibilities on the given set of rules with the specified new entity. In this case the Id can be the id of either a Workgroup or a User.

This method should handle any versioning of the rules that is required.

Throws:
WorkflowException

removeRuleInvolvement

void removeRuleInvolvement(Id entityToBeRemoved,
                           List<Long> ruleIds,
                           Long documentId)
                           throws WorkflowException
Removes entities who have responsibilities on the given set of rules. In the case that a targeted rule contains only a single responsibility the rule will be inactivated instead of removing the responsibility. The Id can be the id of either a Workgroup or a User.

This method should handle any versioning of the rules that is required.

Throws:
WorkflowException

getDuplicateRuleId

Long getDuplicateRuleId(RuleBaseValues rule)
Checks if the Rule with the given value is a duplicate of an existing rule in the system.

Returns:
the id of the duplicate rule if one exists, null otherwise

saveRule

RuleBaseValues saveRule(RuleBaseValues rule,
                        boolean isRetroactiveUpdatePermitted)

saveRules

List<RuleBaseValues> saveRules(List<RuleBaseValues> rulesToSave,
                               boolean isRetroactiveUpdatePermitted)

saveRuleDelegation

RuleDelegation saveRuleDelegation(RuleDelegation ruleDelegation,
                                  boolean isRetroactiveUpdatePermitted)

saveRuleDelegations

List<RuleDelegation> saveRuleDelegations(List<RuleDelegation> ruleDelegationsToSave,
                                         boolean isRetroactiveUpdatePermitted)

findResponsibilityIdForRule

Long findResponsibilityIdForRule(String ruleName,
                                 String ruleResponsibilityName,
                                 String ruleResponsibilityType)


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