001: /*
002: * Copyright 2005-2006 The Kuali Foundation.
003: *
004: *
005: * Licensed under the Educational Community License, Version 1.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.opensource.org/licenses/ecl1.php
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package edu.iu.uis.eden.routetemplate;
018:
019: import java.sql.Timestamp;
020: import java.util.Collection;
021: import java.util.List;
022: import java.util.Map;
023:
024: import edu.iu.uis.eden.XmlLoader;
025: import edu.iu.uis.eden.doctype.DocumentType;
026: import edu.iu.uis.eden.exception.EdenUserNotFoundException;
027: import edu.iu.uis.eden.user.UserId;
028: import edu.iu.uis.eden.user.WorkflowUser;
029: import edu.iu.uis.eden.workgroup.GroupId;
030: import edu.iu.uis.eden.xml.export.XmlExporter;
031:
032: /**
033: * A service which provides data access and functions for the KEW Rules engine.
034: *
035: * @see RuleBaseValues
036: * @see RuleResponsibility
037: *
038: * @author rkirkend
039: * @author jhopf
040: * @author ewestfal
041: */
042: public interface RuleService extends XmlLoader, XmlExporter {
043:
044: //public Long route(MyRules myRules, WorkflowUser user, String annotation) throws Exception;
045: public Long route2(Long routeHeaderId, MyRules2 myRules,
046: WorkflowUser user, String annotation, boolean blanketApprove)
047: throws Exception;
048:
049: public Long routeRuleWithDelegate(Long routeHeaderId,
050: RuleBaseValues parentRule, RuleBaseValues delegateRule,
051: WorkflowUser user, String annotation, boolean blanketApprove)
052: throws Exception;
053:
054: //public void save(RuleBaseValues ruleBaseValues) throws Exception;
055: public void save2(RuleBaseValues ruleBaseValues) throws Exception;
056:
057: public void validate2(RuleBaseValues ruleBaseValues,
058: RuleDelegation ruleDelegation, List errors)
059: throws Exception;
060:
061: public void delete(Long ruleBaseValuesId);
062:
063: public RuleBaseValues findRuleBaseValuesById(Long ruleBaseValuesId);
064:
065: public List search(String docTypeName, Long ruleId,
066: Long ruleTemplateId, String ruleDescription,
067: Long workgroupId, String workflowId, String roleName,
068: Boolean delegateRule, Boolean activeInd, Map extensionValues);
069:
070: public List search(String docTypeName, String ruleTemplateName,
071: String ruleDescription, GroupId workgroupId, UserId userId,
072: String roleName, Boolean workgroupMember,
073: Boolean delegateRule, Boolean activeInd,
074: Map extensionValues, Collection<String> actionRequestCodes)
075: throws EdenUserNotFoundException;
076:
077: public RuleResponsibility findRuleResponsibility(
078: Long responsibilityId);
079:
080: public void deleteRuleResponsibilityById(Long ruleResponsibilityId);
081:
082: public RuleResponsibility findByRuleResponsibilityId(
083: Long ruleResponsibilityId);
084:
085: public List fetchAllCurrentRulesForTemplateDocCombination(
086: String ruleTemplateName, String documentType);
087:
088: public List fetchAllCurrentRulesForTemplateDocCombination(
089: String ruleTemplateName, String documentType,
090: boolean ignoreCache);
091:
092: public List fetchAllCurrentRulesForTemplateDocCombination(
093: String ruleTemplateName, String documentType,
094: Timestamp effectiveDate);
095:
096: public List findByRouteHeaderId(Long routeHeaderId);
097:
098: public void makeCurrent(Long routeHeaderId)
099: throws EdenUserNotFoundException;
100:
101: public List findRuleBaseValuesByResponsibilityReviewer(
102: String reviewerName, String type);
103:
104: public Long isLockedForRouting(Long currentRuleBaseValuesId);
105:
106: public List fetchAllRules(boolean currentRules);
107:
108: public void saveDeactivationDate(RuleBaseValues rule);
109:
110: public RuleBaseValues findDefaultRuleByRuleTemplateId(
111: Long ruleTemplateId);
112:
113: public void notifyCacheOfRuleChange(RuleBaseValues rule,
114: DocumentType documentType);
115:
116: public RuleBaseValues getParentRule(Long ruleBaseValuesId);
117:
118: /**
119: * Notifies the Rule system that the given DocumentType has been changed. When a DocumentType changes this
120: * could result in the change to the DocumentType hierarchy. In these cases we want to ensure that all
121: * Rules within that DocumentType hierarchy get flushed from the cache so they can be re-cached with the proper
122: * DocumentType hierarchy in place.
123: */
124: public void notifyCacheOfDocumentTypeChange(
125: DocumentType documentType);
126:
127: /**
128: * Returns the name of the document type definition that should be used to route the given List of rules. This method will never
129: * return a null value, as it will default to the default Rule document type name if not custom document type is configured for
130: * the given rules.
131: */
132: public String getRuleDocmentTypeName(List rules);
133:
134: }
|