Coverage Report - org.kuali.rice.kew.rule.service.RuleService
 
Classes in this File Line Coverage Branch Coverage Complexity
RuleService
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright 2005-2008 The Kuali Foundation
 3  
  *
 4  
  *
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  *
 9  
  * http://www.opensource.org/licenses/ecl2.php
 10  
  *
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.kuali.rice.kew.rule.service;
 18  
 
 19  
 import java.sql.Timestamp;
 20  
 import java.util.Collection;
 21  
 import java.util.List;
 22  
 import java.util.Map;
 23  
 
 24  
 import org.kuali.rice.core.framework.impex.xml.XmlExporter;
 25  
 import org.kuali.rice.core.framework.impex.xml.XmlLoader;
 26  
 import org.kuali.rice.kew.doctype.bo.DocumentType;
 27  
 import org.kuali.rice.kew.rule.RuleBaseValues;
 28  
 import org.kuali.rice.kew.rule.RuleDelegation;
 29  
 import org.kuali.rice.kew.rule.RuleResponsibility;
 30  
 import org.kuali.rice.kim.api.identity.principal.PrincipalContract;
 31  
 
 32  
 
 33  
 
 34  
 /**
 35  
  * A service which provides data access and functions for the KEW Rules engine.
 36  
  *
 37  
  * @see RuleBaseValues
 38  
  * @see RuleResponsibility
 39  
  *
 40  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 41  
  */
 42  
 public interface RuleService extends XmlLoader, XmlExporter {
 43  
 
 44  
     /**
 45  
      * Returns a Rule based on unique name.  Returns null if name is null.
 46  
      * @param name the rule name
 47  
      * @return the Rule if found, null if not found or null name
 48  
      */
 49  
     public RuleBaseValues getRuleByName(String name);
 50  
 
 51  
     public String routeRuleWithDelegate(String documentId, RuleBaseValues parentRule, RuleBaseValues delegateRule, PrincipalContract principal, String annotation, boolean blanketApprove) throws Exception;
 52  
     //public void save(RuleBaseValues ruleBaseValues) throws Exception;
 53  
     public void save2(RuleBaseValues ruleBaseValues) throws Exception;
 54  
     public void validate2(RuleBaseValues ruleBaseValues, RuleDelegation ruleDelegation, List errors) throws Exception;
 55  
     public void delete(String ruleBaseValuesId);
 56  
     public RuleBaseValues findRuleBaseValuesById(String ruleBaseValuesId);
 57  
     public List<RuleBaseValues> search(String docTypeName, String ruleId, String ruleTemplateId, String ruleDescription, String groupId, String principalId, Boolean delegateRule, Boolean activeInd, Map extensionValues, String workflowIdDirective);
 58  
     public List<RuleBaseValues> searchByTemplate(String docTypeName, String ruleTemplateName, String ruleDescription, String groupId, String principalId, Boolean workgroupMember, Boolean delegateRule, Boolean activeInd, Map extensionValues, Collection<String> actionRequestCodes);
 59  
     public RuleResponsibility findRuleResponsibility(String responsibilityId);
 60  
     public void deleteRuleResponsibilityById(String ruleResponsibilityId);
 61  
     public RuleResponsibility findByRuleResponsibilityId(String ruleResponsibilityId);
 62  
     public List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType);
 63  
     public List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType, boolean ignoreCache);
 64  
     public List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType, Timestamp effectiveDate);
 65  
     public List<RuleBaseValues> findByDocumentId(String documentId);
 66  
     public void makeCurrent(String documentId);
 67  
     public void makeCurrent(RuleBaseValues rule, boolean isRetroactiveUpdatePermitted);
 68  
     public void makeCurrent(RuleDelegation ruleDelegation, boolean isRetroactiveUpdatePermitted);
 69  
     public List findRuleBaseValuesByResponsibilityReviewer(String reviewerName, String type);
 70  
     public List findRuleBaseValuesByResponsibilityReviewerTemplateDoc(String ruleTemplateName, String documentType, String reviewerName, String type);
 71  
     public String isLockedForRouting(String currentRuleBaseValuesId);
 72  
     public List fetchAllRules(boolean currentRules);
 73  
     public RuleBaseValues findDefaultRuleByRuleTemplateId(String ruleTemplateId);
 74  
     public void notifyCacheOfRuleChange(RuleBaseValues rule, DocumentType documentType);
 75  
     public RuleBaseValues getParentRule(String ruleBaseValuesId);
 76  
 
 77  
 
 78  
     /**
 79  
      * Notifies the Rule system that the given DocumentType has been changed.  When a DocumentType changes this
 80  
      * could result in the change to the DocumentType hierarchy.  In these cases we want to ensure that all
 81  
      * Rules within that DocumentType hierarchy get flushed from the cache so they can be re-cached with the proper
 82  
      * DocumentType hierarchy in place.
 83  
      */
 84  
     public void notifyCacheOfDocumentTypeChange(DocumentType documentType);
 85  
 
 86  
     public void flushRuleCache();
 87  
 
 88  
     /**
 89  
      * Returns the name of the document type definition that should be used to route the given List of rules.  This method will never
 90  
      * return a null value, as it will default to the default Rule document type name if not custom document type is configured for
 91  
      * the given rules.
 92  
      */
 93  
     public String getRuleDocmentTypeName(List rules);
 94  
 
 95  
     /**
 96  
      * Checks if the Rule with the given value is a duplicate of an existing rule in the system.
 97  
      * 
 98  
      * @return the id of the duplicate rule if one exists, null otherwise
 99  
      */
 100  
     public String getDuplicateRuleId(RuleBaseValues rule);
 101  
         
 102  
     public RuleBaseValues saveRule(RuleBaseValues rule, boolean isRetroactiveUpdatePermitted);
 103  
     
 104  
     public List<RuleBaseValues> saveRules(List<RuleBaseValues> rulesToSave, boolean isRetroactiveUpdatePermitted);
 105  
     
 106  
     public RuleDelegation saveRuleDelegation(RuleDelegation ruleDelegation, boolean isRetroactiveUpdatePermitted);
 107  
     
 108  
     public List<RuleDelegation> saveRuleDelegations(List<RuleDelegation> ruleDelegationsToSave, boolean isRetroactiveUpdatePermitted);
 109  
     
 110  
     public String findResponsibilityIdForRule(String ruleName, String ruleResponsibilityName, String ruleResponsibilityType);
 111  
 }