public class RuleServiceInternalImpl extends Object implements RuleServiceInternal
Modifier and Type | Class and Description |
---|---|
class |
RuleServiceInternalImpl.RuleDelegationSorter
A comparator implementation which compares RuleBaseValues and puts all delegate rules first.
|
Constructor and Description |
---|
RuleServiceInternalImpl() |
Modifier and Type | Method and Description |
---|---|
protected RuleBaseValues |
createNewRuleVersion(RuleBaseValues existingRule,
String documentId) |
void |
delete(String ruleBaseValuesId) |
void |
deleteRuleResponsibilityById(String ruleResponsibilityId) |
org.jdom.Element |
export(ExportDataSet dataSet) |
List |
fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName,
String documentType) |
List |
fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName,
String documentType,
Timestamp effectiveDate) |
List |
fetchAllRules(boolean currentRules) |
List<RuleBaseValues> |
findByDocumentId(String documentId) |
RuleResponsibilityBo |
findByRuleResponsibilityId(String ruleResponsibilityId) |
RuleBaseValues |
findDefaultRuleByRuleTemplateId(String ruleTemplateId) |
String |
findResponsibilityIdForRule(String ruleName,
String ruleResponsibilityName,
String ruleResponsibilityType) |
RuleBaseValues |
findRuleBaseValuesById(String ruleBaseValuesId) |
List |
findRuleBaseValuesByResponsibilityReviewer(String reviewerName,
String type) |
List |
findRuleBaseValuesByResponsibilityReviewerTemplateDoc(String ruleTemplateName,
String documentType,
String reviewerName,
String type) |
RuleResponsibilityBo |
findRuleResponsibility(String responsibilityId) |
ActionRequestService |
getActionRequestService() |
DataObjectService |
getDataObjectService() |
DocumentTypeService |
getDocumentTypeService() |
String |
getDuplicateRuleId(RuleBaseValues rule)
Checks if the Rule with the given value is a duplicate of an existing rule in the system.
|
GroupService |
getGroupService() |
RuleBaseValues |
getParentRule(RuleBaseValues rule) |
RuleBaseValues |
getParentRule(String ruleBaseValuesId) |
RuleBaseValues |
getRuleByName(String name)
Returns a Rule based on unique name.
|
protected String |
getRuleByTemplateAndDocTypeCacheKey(String ruleTemplateName,
String docTypeName) |
RuleDAO |
getRuleDAO() |
protected RuleDelegationBo |
getRuleDelegationForDelegateRule(RuleBaseValues rule) |
String |
getRuleDocumentTypeName(List rules)
This configuration is currently stored in a system parameter named "CUSTOM_DOCUMENT_TYPES ",
long term we should come up with a better solution.
|
RuleResponsibilityDAO |
getRuleResponsibilityDAO() |
RuleTemplateService |
getRuleTemplateService() |
protected void |
hookUpDelegateRuleToParentRule(RuleBaseValues newParentRule,
RuleBaseValues newDelegationRule,
RuleDelegationBo existingRuleDelegation) |
String |
isLockedForRouting(String currentRuleBaseValuesId)
Determines if the given rule is locked for routing.
|
protected List<RuleBaseValues> |
loadRules(List<String> ruleIds) |
void |
loadXml(InputStream inputStream,
String principalId) |
void |
makeCurrent(List<RuleBaseValues> rules) |
void |
makeCurrent(RuleBaseValues rule,
boolean isRetroactiveUpdatePermitted)
makeCurrent(RuleBaseValues) is the version of makeCurrent which is initiated from the new Routing Rule
Maintenance document.
|
void |
makeCurrent(RuleDelegationBo ruleDelegation,
boolean isRetroactiveUpdatePermitted) |
protected void |
makeCurrent(RuleDelegationBo ruleDelegation,
RuleBaseValues rule,
boolean isRetroactiveUpdatePermitted) |
void |
makeCurrent(String documentId) |
void |
makeCurrent2(List<RuleBaseValues> rules)
TODO consolidate this method with makeCurrent.
|
String |
routeRuleWithDelegate(String documentId,
RuleBaseValues parentRule,
RuleBaseValues delegateRule,
PrincipalContract principal,
String annotation,
boolean blanketApprove) |
void |
save2(RuleBaseValues ruleBaseValues) |
void |
save2(RuleBaseValues ruleBaseValues,
RuleDelegationBo ruleDelegation,
boolean saveDelegations) |
RuleBaseValues |
saveRule(RuleBaseValues rule,
boolean isRetroactiveUpdatePermitted) |
RuleDelegationBo |
saveRuleDelegation(RuleDelegationBo ruleDelegation,
boolean isRetroactiveUpdatePermitted) |
List<RuleDelegationBo> |
saveRuleDelegations(List<RuleDelegationBo> ruleDelegationsToSave,
boolean isRetroactiveUpdatePermitted) |
List<RuleBaseValues> |
saveRules(List<RuleBaseValues> rulesToSave,
boolean isRetroactiveUpdatePermitted) |
List<RuleBaseValues> |
search(String docTypeName,
String ruleId,
String ruleTemplateId,
String ruleDescription,
String groupId,
String principalId,
Boolean delegateRule,
Boolean activeInd,
Map extensionValues,
String workflowIdDirective) |
List<RuleBaseValues> |
searchByTemplate(String docTypeName,
String ruleTemplateName,
String ruleDescription,
String groupId,
String principalId,
Boolean workgroupMember,
Boolean delegateRule,
Boolean activeInd,
Map extensionValues,
Collection<String> actionRequestCodes) |
void |
setDataObjectService(DataObjectService dataObjectService) |
void |
setRuleDAO(RuleDAO ruleDAO) |
void |
setRuleResponsibilityDAO(RuleResponsibilityDAO ruleResponsibilityDAO) |
protected boolean |
shouldChangeRuleInvolvement(String documentId,
RuleBaseValues rule)
If a rule has been modified and is no longer current since the original request was made, we need to
be sure to NOT update the rule.
|
boolean |
supportPrettyPrint() |
void |
validate(RuleBaseValues ruleBaseValues,
List errors) |
void |
validate2(RuleBaseValues ruleBaseValues,
RuleDelegationBo ruleDelegation,
List errors) |
public RuleServiceInternalImpl()
public RuleResponsibilityDAO getRuleResponsibilityDAO()
public RuleBaseValues getRuleByName(String name)
RuleServiceInternal
getRuleByName
in interface RuleServiceInternal
name
- the rule namepublic RuleBaseValues findDefaultRuleByRuleTemplateId(String ruleTemplateId)
findDefaultRuleByRuleTemplateId
in interface RuleServiceInternal
public void setRuleResponsibilityDAO(RuleResponsibilityDAO ruleResponsibilityDAO)
public void save2(RuleBaseValues ruleBaseValues) throws Exception
save2
in interface RuleServiceInternal
Exception
public void save2(RuleBaseValues ruleBaseValues, RuleDelegationBo ruleDelegation, boolean saveDelegations) throws Exception
Exception
public void makeCurrent(String documentId)
makeCurrent
in interface RuleServiceInternal
public void makeCurrent(List<RuleBaseValues> rules)
public void makeCurrent2(List<RuleBaseValues> rules)
This version will only work for remove/replace operations where rules aren't being added or removed. This is why it doesn't perform some of the functions like checking for delegation rules that were removed from a parent rule.
public void makeCurrent(RuleBaseValues rule, boolean isRetroactiveUpdatePermitted)
makeCurrent
in interface RuleServiceInternal
public void makeCurrent(RuleDelegationBo ruleDelegation, boolean isRetroactiveUpdatePermitted)
makeCurrent
in interface RuleServiceInternal
protected void makeCurrent(RuleDelegationBo ruleDelegation, RuleBaseValues rule, boolean isRetroactiveUpdatePermitted)
public RuleBaseValues getParentRule(String ruleBaseValuesId)
getParentRule
in interface RuleServiceInternal
public String routeRuleWithDelegate(String documentId, RuleBaseValues parentRule, RuleBaseValues delegateRule, PrincipalContract principal, String annotation, boolean blanketApprove) throws Exception
routeRuleWithDelegate
in interface RuleServiceInternal
Exception
public void validate(RuleBaseValues ruleBaseValues, List errors)
public void validate2(RuleBaseValues ruleBaseValues, RuleDelegationBo ruleDelegation, List errors)
validate2
in interface RuleServiceInternal
public List<RuleBaseValues> findByDocumentId(String documentId)
findByDocumentId
in interface RuleServiceInternal
public List<RuleBaseValues> search(String docTypeName, String ruleId, String ruleTemplateId, String ruleDescription, String groupId, String principalId, Boolean delegateRule, Boolean activeInd, Map extensionValues, String workflowIdDirective)
search
in interface RuleServiceInternal
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)
searchByTemplate
in interface RuleServiceInternal
public void delete(String ruleBaseValuesId)
delete
in interface RuleServiceInternal
public RuleBaseValues findRuleBaseValuesById(String ruleBaseValuesId)
findRuleBaseValuesById
in interface RuleServiceInternal
public RuleResponsibilityBo findRuleResponsibility(String responsibilityId)
findRuleResponsibility
in interface RuleServiceInternal
public List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType)
fetchAllCurrentRulesForTemplateDocCombination
in interface RuleServiceInternal
public List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType, Timestamp effectiveDate)
fetchAllCurrentRulesForTemplateDocCombination
in interface RuleServiceInternal
public List fetchAllRules(boolean currentRules)
fetchAllRules
in interface RuleServiceInternal
public String isLockedForRouting(String currentRuleBaseValuesId)
isLockedForRouting
in interface RuleServiceInternal
public RuleBaseValues getParentRule(RuleBaseValues rule)
public String getRuleDocumentTypeName(List rules)
getRuleDocumentTypeName
in interface RuleServiceInternal
public void setRuleDAO(RuleDAO ruleDAO)
public RuleDAO getRuleDAO()
public void deleteRuleResponsibilityById(String ruleResponsibilityId)
deleteRuleResponsibilityById
in interface RuleServiceInternal
public RuleResponsibilityBo findByRuleResponsibilityId(String ruleResponsibilityId)
findByRuleResponsibilityId
in interface RuleServiceInternal
public List findRuleBaseValuesByResponsibilityReviewer(String reviewerName, String type)
findRuleBaseValuesByResponsibilityReviewer
in interface RuleServiceInternal
public List findRuleBaseValuesByResponsibilityReviewerTemplateDoc(String ruleTemplateName, String documentType, String reviewerName, String type)
findRuleBaseValuesByResponsibilityReviewerTemplateDoc
in interface RuleServiceInternal
public RuleTemplateService getRuleTemplateService()
public DocumentTypeService getDocumentTypeService()
public GroupService getGroupService()
public ActionRequestService getActionRequestService()
public void loadXml(InputStream inputStream, String principalId)
public org.jdom.Element export(ExportDataSet dataSet)
export
in interface XmlExporter
public boolean supportPrettyPrint()
supportPrettyPrint
in interface XmlExporter
protected List<RuleBaseValues> loadRules(List<String> ruleIds)
protected boolean shouldChangeRuleInvolvement(String documentId, RuleBaseValues rule)
protected RuleDelegationBo getRuleDelegationForDelegateRule(RuleBaseValues rule)
protected void hookUpDelegateRuleToParentRule(RuleBaseValues newParentRule, RuleBaseValues newDelegationRule, RuleDelegationBo existingRuleDelegation)
protected RuleBaseValues createNewRuleVersion(RuleBaseValues existingRule, String documentId) throws Exception
Exception
public String getDuplicateRuleId(RuleBaseValues rule)
RuleServiceInternal
getDuplicateRuleId
in interface RuleServiceInternal
public RuleBaseValues saveRule(RuleBaseValues rule, boolean isRetroactiveUpdatePermitted)
saveRule
in interface RuleServiceInternal
public List<RuleBaseValues> saveRules(List<RuleBaseValues> rulesToSave, boolean isRetroactiveUpdatePermitted)
saveRules
in interface RuleServiceInternal
public RuleDelegationBo saveRuleDelegation(RuleDelegationBo ruleDelegation, boolean isRetroactiveUpdatePermitted)
saveRuleDelegation
in interface RuleServiceInternal
public List<RuleDelegationBo> saveRuleDelegations(List<RuleDelegationBo> ruleDelegationsToSave, boolean isRetroactiveUpdatePermitted)
saveRuleDelegations
in interface RuleServiceInternal
public String findResponsibilityIdForRule(String ruleName, String ruleResponsibilityName, String ruleResponsibilityType)
findResponsibilityIdForRule
in interface RuleServiceInternal
protected String getRuleByTemplateAndDocTypeCacheKey(String ruleTemplateName, String docTypeName)
public DataObjectService getDataObjectService()
public void setDataObjectService(DataObjectService dataObjectService)
Copyright © 2005–2014 The Kuali Foundation. All rights reserved.