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.kew.doctype.bo.DocumentType;
 25  
 import org.kuali.rice.kew.exception.WorkflowException;
 26  
 import org.kuali.rice.kew.identity.Id;
 27  
 import org.kuali.rice.kew.rule.MyRules2;
 28  
 import org.kuali.rice.kew.rule.RuleBaseValues;
 29  
 import org.kuali.rice.kew.rule.RuleDelegation;
 30  
 import org.kuali.rice.kew.rule.RuleResponsibility;
 31  
 import org.kuali.rice.kew.xml.XmlLoader;
 32  
 import org.kuali.rice.kew.xml.export.XmlExporter;
 33  
 import org.kuali.rice.kim.bo.entity.KimPrincipal;
 34  
 
 35  
 
 36  
 /**
 37  
  * A service which provides data access and functions for the KEW Rules engine.
 38  
  *
 39  
  * @see RuleBaseValues
 40  
  * @see RuleResponsibility
 41  
  *
 42  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 43  
  */
 44  
 public interface RuleService extends XmlLoader, XmlExporter {
 45  
 
 46  
     /**
 47  
      * Returns a Rule based on unique name.  Returns null if name is null.
 48  
      * @param name the rule name
 49  
      * @return the Rule if found, null if not found or null name
 50  
      */
 51  
     public RuleBaseValues getRuleByName(String name);
 52  
 
 53  
     //public Long route(MyRules myRules, WorkflowUser user, String annotation) throws Exception;
 54  
     public Long route2(Long routeHeaderId, MyRules2 myRules, KimPrincipal principal, String annotation, boolean blanketApprove) throws Exception;
 55  
     public Long routeRuleWithDelegate(Long routeHeaderId, RuleBaseValues parentRule, RuleBaseValues delegateRule, KimPrincipal principal, String annotation, boolean blanketApprove) throws Exception;
 56  
     //public void save(RuleBaseValues ruleBaseValues) throws Exception;
 57  
     public void save2(RuleBaseValues ruleBaseValues) throws Exception;
 58  
     public void validate2(RuleBaseValues ruleBaseValues, RuleDelegation ruleDelegation, List errors) throws Exception;
 59  
     public void delete(Long ruleBaseValuesId);
 60  
     public RuleBaseValues findRuleBaseValuesById(Long ruleBaseValuesId);
 61  
     public List search(String docTypeName, Long ruleId, Long ruleTemplateId, String ruleDescription, String groupId, String principalId, Boolean delegateRule, Boolean activeInd, Map extensionValues, String workflowIdDirective);
 62  
     public List search(String docTypeName, String ruleTemplateName, String ruleDescription, String groupId, String principalId, Boolean workgroupMember, Boolean delegateRule, Boolean activeInd, Map extensionValues, Collection<String> actionRequestCodes);
 63  
     public RuleResponsibility findRuleResponsibility(Long responsibilityId);
 64  
     public void deleteRuleResponsibilityById(Long ruleResponsibilityId);
 65  
     public RuleResponsibility findByRuleResponsibilityId(Long ruleResponsibilityId);
 66  
     public List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType);
 67  
     public List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType, boolean ignoreCache);
 68  
     public List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType, Timestamp effectiveDate);
 69  
     public List findByRouteHeaderId(Long routeHeaderId);
 70  
     public void makeCurrent(Long routeHeaderId);
 71  
     public void makeCurrent(RuleBaseValues rule, boolean isRetroactiveUpdatePermitted);
 72  
     public void makeCurrent(RuleDelegation ruleDelegation, boolean isRetroactiveUpdatePermitted);
 73  
     public List findRuleBaseValuesByResponsibilityReviewer(String reviewerName, String type);
 74  
     public List findRuleBaseValuesByResponsibilityReviewerTemplateDoc(String ruleTemplateName, String documentType, String reviewerName, String type);
 75  
     public Long isLockedForRouting(Long currentRuleBaseValuesId);
 76  
     public List fetchAllRules(boolean currentRules);
 77  
     public RuleBaseValues findDefaultRuleByRuleTemplateId(Long ruleTemplateId);
 78  
     public void notifyCacheOfRuleChange(RuleBaseValues rule, DocumentType documentType);
 79  
     public RuleBaseValues getParentRule(Long ruleBaseValuesId);
 80  
 
 81  
 
 82  
     /**
 83  
      * Notifies the Rule system that the given DocumentType has been changed.  When a DocumentType changes this
 84  
      * could result in the change to the DocumentType hierarchy.  In these cases we want to ensure that all
 85  
      * Rules within that DocumentType hierarchy get flushed from the cache so they can be re-cached with the proper
 86  
      * DocumentType hierarchy in place.
 87  
      */
 88  
     public void notifyCacheOfDocumentTypeChange(DocumentType documentType);
 89  
 
 90  
     public void flushRuleCache();
 91  
 
 92  
     /**
 93  
      * Returns the name of the document type definition that should be used to route the given List of rules.  This method will never
 94  
      * return a null value, as it will default to the default Rule document type name if not custom document type is configured for
 95  
      * the given rules.
 96  
      */
 97  
     public String getRuleDocmentTypeName(List rules);
 98  
 
 99  
     /**
 100  
      * Replaces entities who have responsibilities on the given set of rules with the specified new entity.  In this case
 101  
      * the Id can be the id of either a Workgroup or a User.
 102  
      *
 103  
      * <p>This method should handle any versioning of the rules that is required.
 104  
      */
 105  
     public void replaceRuleInvolvement(Id entityToBeReplaced, Id newEntity, List<Long> ruleIds, Long documentId) throws WorkflowException;
 106  
 
 107  
     /**
 108  
      * Removes entities who have responsibilities on the given set of rules.  In the case that a targeted rule
 109  
      * contains only a single responsibility the rule will be inactivated instead of removing the responsibility.
 110  
      * The Id can be the id of either a Workgroup or a User.
 111  
      *
 112  
      * <p>This method should handle any versioning of the rules that is required.
 113  
      */
 114  
     public void removeRuleInvolvement(Id entityToBeRemoved, List<Long> ruleIds, Long documentId) throws WorkflowException;
 115  
 
 116  
     /**
 117  
      * Checks if the Rule with the given value is a duplicate of an existing rule in the system.
 118  
      * 
 119  
      * @return the id of the duplicate rule if one exists, null otherwise
 120  
      */
 121  
     public Long getDuplicateRuleId(RuleBaseValues rule);
 122  
         
 123  
     public RuleBaseValues saveRule(RuleBaseValues rule, boolean isRetroactiveUpdatePermitted);
 124  
     
 125  
     public List<RuleBaseValues> saveRules(List<RuleBaseValues> rulesToSave, boolean isRetroactiveUpdatePermitted);
 126  
     
 127  
     public RuleDelegation saveRuleDelegation(RuleDelegation ruleDelegation, boolean isRetroactiveUpdatePermitted);
 128  
     
 129  
     public List<RuleDelegation> saveRuleDelegations(List<RuleDelegation> ruleDelegationsToSave, boolean isRetroactiveUpdatePermitted);
 130  
     
 131  
     public Long findResponsibilityIdForRule(String ruleName, String ruleResponsibilityName, String ruleResponsibilityType);
 132  
 }