|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.kew.rule.service.impl.RuleServiceImpl
public class RuleServiceImpl
Nested Class Summary | |
---|---|
class |
RuleServiceImpl.RuleDelegationSorter
A comparator implementation which compares RuleBaseValues and puts all delegate rules first. |
Constructor Summary | |
---|---|
RuleServiceImpl()
|
Method Summary | |
---|---|
protected RuleBaseValues |
createNewRuleVersion(RuleBaseValues existingRule,
Long documentId)
|
void |
delete(Long ruleBaseValuesId)
|
void |
deleteRuleResponsibilityById(Long ruleResponsibilityId)
|
org.jdom.Element |
export(ExportDataSet dataSet)
|
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)
|
protected void |
flushDocumentTypeFromCache(String documentTypeName)
|
protected void |
flushListFromCache(String ruleTemplateName,
String documentTypeName)
|
void |
flushRuleCache()
|
ActionRequestService |
getActionRequestService()
|
protected String |
getDocumentTypeRuleCacheGroupName(String documentTypeName)
|
DocumentTypeService |
getDocumentTypeService()
|
Long |
getDuplicateRuleId(RuleBaseValues rule)
Checks if the Rule with the given value is a duplicate of an existing rule in the system. |
IdentityManagementService |
getIdentityManagementService()
|
protected List<RuleBaseValues> |
getListFromCache(String ruleTemplateName,
String documentTypeName)
|
RuleBaseValues |
getParentRule(Long ruleBaseValuesId)
|
RuleBaseValues |
getParentRule(RuleBaseValues rule)
|
RuleBaseValues |
getRuleByName(String name)
Returns a Rule based on unique name. |
protected String |
getRuleCacheKey(String ruleTemplateName,
String docTypeName)
Returns the key of the rule cache. |
RuleDAO |
getRuleDAO()
|
protected RuleDelegation |
getRuleDelegationForDelegateRule(RuleBaseValues rule)
|
protected String |
getRuleDlgnCacheKey(Long responsibilityId)
|
String |
getRuleDocmentTypeName(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,
RuleDelegation existingRuleDelegation)
|
Long |
isLockedForRouting(Long currentRuleBaseValuesId)
Determines if the given rule is locked for routing. |
protected List<RuleBaseValues> |
loadRules(List<Long> ruleIds)
|
void |
loadXml(InputStream inputStream,
String principalId)
|
void |
makeCurrent(List rules)
|
void |
makeCurrent(Long routeHeaderId)
|
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(RuleDelegation ruleDelegation,
boolean isRetroactiveUpdatePermitted)
|
protected void |
makeCurrent(RuleDelegation ruleDelegation,
RuleBaseValues rule,
boolean isRetroactiveUpdatePermitted)
|
void |
makeCurrent2(List rules)
TODO consolidate this method with makeCurrent. |
void |
notifyCacheOfDocumentTypeChange(DocumentType documentType)
Notifies the Rule system that the given DocumentType has been changed. |
protected void |
notifyCacheOfDocumentTypeChangeFromParent(DocumentType documentType)
Flushes rules cached for the given DocumentType and then recursivley flushes rules cached for all children DocumentTypes. |
protected void |
notifyCacheOfDocumentTypeChangeFromRoot(DocumentType rootDocumentType,
DocumentType documentType)
Flushes rules cached from the root of the DocumentType hierarchy (at the given root DocumentType). |
void |
notifyCacheOfRuleChange(RuleBaseValues rule,
DocumentType documentType)
|
protected void |
putListInCache(String ruleTemplateName,
String documentTypeName,
List<RuleBaseValues> rules)
|
Long |
routeRuleWithDelegate(Long routeHeaderId,
RuleBaseValues parentRule,
RuleBaseValues delegateRule,
KimPrincipal principal,
String annotation,
boolean blanketApprove)
|
void |
save2(RuleBaseValues ruleBaseValues)
|
void |
save2(RuleBaseValues ruleBaseValues,
RuleDelegation ruleDelegation,
boolean saveDelegations)
|
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 |
setRuleDAO(RuleDAO ruleDAO)
|
void |
setRuleResponsibilityDAO(RuleResponsibilityDAO ruleResponsibilityDAO)
|
protected boolean |
shouldChangeRuleInvolvement(Long 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,
RuleDelegation ruleDelegation,
List errors)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RuleServiceImpl()
Method Detail |
---|
public RuleResponsibilityDAO getRuleResponsibilityDAO()
public RuleBaseValues getRuleByName(String name)
RuleService
getRuleByName
in interface RuleService
name
- the rule name
public RuleBaseValues findDefaultRuleByRuleTemplateId(Long ruleTemplateId)
findDefaultRuleByRuleTemplateId
in interface RuleService
public void setRuleResponsibilityDAO(RuleResponsibilityDAO ruleResponsibilityDAO)
public void save2(RuleBaseValues ruleBaseValues) throws Exception
save2
in interface RuleService
Exception
public void save2(RuleBaseValues ruleBaseValues, RuleDelegation ruleDelegation, boolean saveDelegations) throws Exception
Exception
public void makeCurrent(Long routeHeaderId)
makeCurrent
in interface RuleService
public void makeCurrent(List rules)
public void makeCurrent2(List 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 RuleService
public void makeCurrent(RuleDelegation ruleDelegation, boolean isRetroactiveUpdatePermitted)
makeCurrent
in interface RuleService
protected void makeCurrent(RuleDelegation ruleDelegation, RuleBaseValues rule, boolean isRetroactiveUpdatePermitted)
protected String getRuleDlgnCacheKey(Long responsibilityId)
public RuleBaseValues getParentRule(Long ruleBaseValuesId)
getParentRule
in interface RuleService
public void notifyCacheOfDocumentTypeChange(DocumentType documentType)
RuleService
notifyCacheOfDocumentTypeChange
in interface RuleService
protected void notifyCacheOfDocumentTypeChangeFromParent(DocumentType documentType)
protected void notifyCacheOfDocumentTypeChangeFromRoot(DocumentType rootDocumentType, DocumentType documentType)
If such a fix was made then we could simply pass the root DocumentType into notifyCacheOfDocumentTypeChange and be gauranteed that we will see all appropriate children as we call getChildrenDocTypes().
One last note, we don't necesarily have to stop this cache flusing at the given DocumentType but there's no reason to duplicate the work that is going to be done in notifyCacheOfDocumentTypeChangeFromParent.
public void notifyCacheOfRuleChange(RuleBaseValues rule, DocumentType documentType)
notifyCacheOfRuleChange
in interface RuleService
protected String getRuleCacheKey(String ruleTemplateName, String docTypeName)
protected String getDocumentTypeRuleCacheGroupName(String documentTypeName)
protected List<RuleBaseValues> getListFromCache(String ruleTemplateName, String documentTypeName)
protected void putListInCache(String ruleTemplateName, String documentTypeName, List<RuleBaseValues> rules)
protected void flushDocumentTypeFromCache(String documentTypeName)
protected void flushListFromCache(String ruleTemplateName, String documentTypeName)
public void flushRuleCache()
flushRuleCache
in interface RuleService
public Long routeRuleWithDelegate(Long routeHeaderId, RuleBaseValues parentRule, RuleBaseValues delegateRule, KimPrincipal principal, String annotation, boolean blanketApprove) throws Exception
routeRuleWithDelegate
in interface RuleService
Exception
public void validate(RuleBaseValues ruleBaseValues, List errors)
public void validate2(RuleBaseValues ruleBaseValues, RuleDelegation ruleDelegation, List errors)
validate2
in interface RuleService
public List findByRouteHeaderId(Long routeHeaderId)
findByRouteHeaderId
in interface RuleService
public List search(String docTypeName, Long ruleId, Long ruleTemplateId, String ruleDescription, String groupId, String principalId, Boolean delegateRule, Boolean activeInd, Map extensionValues, String workflowIdDirective)
search
in interface RuleService
public List search(String docTypeName, String ruleTemplateName, String ruleDescription, String groupId, String principalId, Boolean workgroupMember, Boolean delegateRule, Boolean activeInd, Map extensionValues, Collection<String> actionRequestCodes)
search
in interface RuleService
public void delete(Long ruleBaseValuesId)
delete
in interface RuleService
public RuleBaseValues findRuleBaseValuesById(Long ruleBaseValuesId)
findRuleBaseValuesById
in interface RuleService
public RuleResponsibility findRuleResponsibility(Long responsibilityId)
findRuleResponsibility
in interface RuleService
public List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType, boolean ignoreCache)
fetchAllCurrentRulesForTemplateDocCombination
in interface RuleService
public List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType)
fetchAllCurrentRulesForTemplateDocCombination
in interface RuleService
public List fetchAllCurrentRulesForTemplateDocCombination(String ruleTemplateName, String documentType, Timestamp effectiveDate)
fetchAllCurrentRulesForTemplateDocCombination
in interface RuleService
public List fetchAllRules(boolean currentRules)
fetchAllRules
in interface RuleService
public Long isLockedForRouting(Long currentRuleBaseValuesId)
isLockedForRouting
in interface RuleService
public RuleBaseValues getParentRule(RuleBaseValues rule)
public String getRuleDocmentTypeName(List rules)
getRuleDocmentTypeName
in interface RuleService
public void setRuleDAO(RuleDAO ruleDAO)
public RuleDAO getRuleDAO()
public void deleteRuleResponsibilityById(Long ruleResponsibilityId)
deleteRuleResponsibilityById
in interface RuleService
public RuleResponsibility findByRuleResponsibilityId(Long ruleResponsibilityId)
findByRuleResponsibilityId
in interface RuleService
public List findRuleBaseValuesByResponsibilityReviewer(String reviewerName, String type)
findRuleBaseValuesByResponsibilityReviewer
in interface RuleService
public List findRuleBaseValuesByResponsibilityReviewerTemplateDoc(String ruleTemplateName, String documentType, String reviewerName, String type)
findRuleBaseValuesByResponsibilityReviewerTemplateDoc
in interface RuleService
public RuleTemplateService getRuleTemplateService()
public DocumentTypeService getDocumentTypeService()
public IdentityManagementService getIdentityManagementService()
public ActionRequestService getActionRequestService()
public void loadXml(InputStream inputStream, String principalId)
loadXml
in interface XmlLoader
public org.jdom.Element export(ExportDataSet dataSet)
export
in interface XmlExporter
public boolean supportPrettyPrint()
supportPrettyPrint
in interface XmlExporter
protected List<RuleBaseValues> loadRules(List<Long> ruleIds)
protected boolean shouldChangeRuleInvolvement(Long documentId, RuleBaseValues rule)
protected RuleDelegation getRuleDelegationForDelegateRule(RuleBaseValues rule)
protected void hookUpDelegateRuleToParentRule(RuleBaseValues newParentRule, RuleBaseValues newDelegationRule, RuleDelegation existingRuleDelegation)
protected RuleBaseValues createNewRuleVersion(RuleBaseValues existingRule, Long documentId) throws Exception
Exception
public Long getDuplicateRuleId(RuleBaseValues rule)
RuleService
getDuplicateRuleId
in interface RuleService
public RuleBaseValues saveRule(RuleBaseValues rule, boolean isRetroactiveUpdatePermitted)
saveRule
in interface RuleService
public List<RuleBaseValues> saveRules(List<RuleBaseValues> rulesToSave, boolean isRetroactiveUpdatePermitted)
saveRules
in interface RuleService
public RuleDelegation saveRuleDelegation(RuleDelegation ruleDelegation, boolean isRetroactiveUpdatePermitted)
saveRuleDelegation
in interface RuleService
public List<RuleDelegation> saveRuleDelegations(List<RuleDelegation> ruleDelegationsToSave, boolean isRetroactiveUpdatePermitted)
saveRuleDelegations
in interface RuleService
public Long findResponsibilityIdForRule(String ruleName, String ruleResponsibilityName, String ruleResponsibilityType)
findResponsibilityIdForRule
in interface RuleService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |