public abstract class DocumentRuleBase extends Object implements SaveDocumentRule, RouteDocumentRule, ApproveDocumentRule, AddNoteRule, AddAdHocRoutePersonRule, AddAdHocRouteWorkgroupRule, SendAdHocRequestsRule, CompleteDocumentRule
Constructor and Description |
---|
DocumentRuleBase() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,String> |
buildDocumentTypeActionRequestPermissionDetails(DocumentType documentType,
String actionRequestCode) |
protected Map<String,String> |
buildDocumentTypePermissionDetails(DocumentType documentType) |
protected DataDictionaryService |
getDataDictionaryService() |
protected DictionaryValidationService |
getDictionaryValidationService() |
protected static DocumentDictionaryService |
getDocumentDictionaryService() |
static GroupService |
getGroupService() |
protected ConfigurationService |
getKualiConfigurationService() |
int |
getMaxDictionaryValidationDepth()
Gets the maximum number of levels the data-dictionary based validation will recurse for the document
|
static PermissionService |
getPermissionService() |
protected PersonService |
getPersonService() |
protected boolean |
hasAdHocRouteCompletion(Document document,
AdHocRouteRecipient adHocRouteRecipient)
KULRICE-8760: check whether there is any other complete adhoc request on the given document
|
boolean |
isAddHocRoutePersonValid(Document document,
AdHocRoutePerson person)
Verifies that the adHocRoutePerson's fields are valid - it does required and format checks.
|
boolean |
isAddHocRouteWorkgroupValid(Document document,
AdHocRouteWorkgroup workgroup)
Verifies that the adHocRouteWorkgroup's fields are valid - it does required and format checks.
|
protected boolean |
isAdHocRouteCompletionToInitiator(Document document,
Person person,
String actionRequestCode)
KULRICE-7419: Adhoc route completion validation rule (should not route to initiator for completion)
determine whether the document initiator is the same as the adhoc recipient for completion
|
protected boolean |
isAdHocRouteRecipientsValid(Document document)
Checks the adhoc route recipient list to ensure there are recipients or
else throws an error that at least one recipient is required.
|
boolean |
isDocumentAttributesValid(Document document,
boolean validateRequired)
Validates the document attributes against the data dictionary.
|
boolean |
isDocumentOverviewValid(Document document)
Verifies that the document's overview fields are valid - it does required and format checks.
|
boolean |
isNoteValid(Note note)
Verifies that the note's fields are valid - it does required and format checks.
|
boolean |
processAddAdHocRoutePerson(Document document,
AdHocRoutePerson adHocRoutePerson)
This method is responsible for housing business rules that need to be checked before a document adHocRoutePerson is added to
a document.
|
boolean |
processAddAdHocRouteWorkgroup(Document document,
AdHocRouteWorkgroup adHocRouteWorkgroup)
This method is responsible for housing business rules that need to be checked before a document adHocRouteWorkgroup is added
to a document.
|
boolean |
processAddNote(Document document,
Note note)
Runs all business rules needed prior to adding a document note.
|
boolean |
processApproveDocument(ApproveDocumentEvent approveEvent)
Runs all business rules needed prior to approving.
|
boolean |
processCompleteDocument(Document document)
Business rules check will include all save action rules and any custom rules required by the document specific rule implementation
|
protected boolean |
processCustomAddAdHocRoutePersonBusinessRules(Document document,
AdHocRoutePerson person)
This method should be overridden by children rule classes as a hook to implement document specific business rule
checks for
the "add ad hoc route person" event.
|
protected boolean |
processCustomAddAdHocRouteWorkgroupBusinessRules(Document document,
AdHocRouteWorkgroup workgroup)
This method should be overridden by children rule classes as a hook to implement document specific business rule
checks for
the "add ad hoc route workgroup" event.
|
protected boolean |
processCustomAddNoteBusinessRules(Document document,
Note note)
This method should be overridden by children rule classes as a hook to implement document specific business rule
checks for
the "add document note" event.
|
protected boolean |
processCustomApproveDocumentBusinessRules(ApproveDocumentEvent approveEvent)
This method should be overridden by children rule classes as a hook to implement document specific business rule
checks for
the "approve document" event.
|
protected boolean |
processCustomCompleteDocumentBusinessRules(Document document)
Hook method for deriving business rule classes to provide custom validations required during completion action
|
protected boolean |
processCustomRouteDocumentBusinessRules(Document document)
This method should be overridden by children rule classes as a hook to implement document specific business rule
checks for
the "route document" event.
|
protected boolean |
processCustomSaveDocumentBusinessRules(Document document)
This method should be overridden by children rule classes as a hook to implement document specific business rule
checks for
the "save document" event.
|
protected boolean |
processCustomSendAdHocRequests(Document document) |
boolean |
processRouteDocument(Document document)
Runs all business rules needed prior to routing.
|
boolean |
processSaveDocument(Document document)
Runs all business rules needed prior to saving.
|
boolean |
processSendAdHocRequests(Document document) |
static void |
setDocumentDictionaryService(DocumentDictionaryService documentDictionaryService) |
void |
setMaxDictionaryValidationDepth(int maxDictionaryValidationDepth)
Gets the maximum number of levels the data-dictionary based validation will recurse for the document
|
protected boolean |
useKimPermission(String namespace,
String permissionTemplateName,
Map<String,String> permissionDetails) |
protected boolean |
validateSensitiveDataValue(String fieldName,
String fieldValue,
String fieldLabel) |
public DocumentRuleBase()
public boolean isDocumentOverviewValid(Document document)
document
- public boolean isDocumentAttributesValid(Document document, boolean validateRequired)
document
- validateRequired
- if true, then an error will be retruned if a DD required field is empty. if false, no
required
checking is donepublic boolean processSaveDocument(Document document)
processSaveDocument
in interface SaveDocumentRule
SaveDocumentRule.processSaveDocument(org.kuali.rice.krad.document.Document)
protected boolean processCustomSaveDocumentBusinessRules(Document document)
document
- public boolean processRouteDocument(Document document)
processRouteDocument
in interface RouteDocumentRule
RouteDocumentRule.processRouteDocument(org.kuali.rice.krad.document.Document)
protected boolean processCustomRouteDocumentBusinessRules(Document document)
document
- public boolean processApproveDocument(ApproveDocumentEvent approveEvent)
processApproveDocument
in interface ApproveDocumentRule
ApproveDocumentRule.processApproveDocument(org.kuali.rice.krad.rules.rule.event.ApproveDocumentEvent)
protected boolean processCustomApproveDocumentBusinessRules(ApproveDocumentEvent approveEvent)
approveEvent
- public boolean processAddNote(Document document, Note note)
processAddNote
in interface AddNoteRule
public boolean isNoteValid(Note note)
note
- protected boolean processCustomAddNoteBusinessRules(Document document, Note note)
document
- note
- public boolean processAddAdHocRoutePerson(Document document, AdHocRoutePerson adHocRoutePerson)
AddAdHocRoutePersonRule
processAddAdHocRoutePerson
in interface AddAdHocRoutePersonRule
AddAdHocRoutePersonRule.processAddAdHocRoutePerson(org.kuali.rice.krad.document.Document,
org.kuali.rice.krad.bo.AdHocRoutePerson)
public boolean processSendAdHocRequests(Document document)
processSendAdHocRequests
in interface SendAdHocRequestsRule
SendAdHocRequestsRule.processSendAdHocRequests(org.kuali.rice.krad.document.Document)
protected boolean processCustomSendAdHocRequests(Document document)
protected boolean isAdHocRouteRecipientsValid(Document document)
document
- public boolean isAddHocRoutePersonValid(Document document, AdHocRoutePerson person)
person
- protected boolean isAdHocRouteCompletionToInitiator(Document document, Person person, String actionRequestCode)
protected boolean hasAdHocRouteCompletion(Document document, AdHocRouteRecipient adHocRouteRecipient)
protected boolean processCustomAddAdHocRoutePersonBusinessRules(Document document, AdHocRoutePerson person)
document
- person
- public boolean processAddAdHocRouteWorkgroup(Document document, AdHocRouteWorkgroup adHocRouteWorkgroup)
AddAdHocRouteWorkgroupRule
processAddAdHocRouteWorkgroup
in interface AddAdHocRouteWorkgroupRule
AddAdHocRouteWorkgroupRule.processAddAdHocRouteWorkgroup(org.kuali.rice.krad.document.Document,
org.kuali.rice.krad.bo.AdHocRouteWorkgroup)
public boolean isAddHocRouteWorkgroupValid(Document document, AdHocRouteWorkgroup workgroup)
workgroup
- protected boolean processCustomAddAdHocRouteWorkgroupBusinessRules(Document document, AdHocRouteWorkgroup workgroup)
document
- workgroup
- public int getMaxDictionaryValidationDepth()
public void setMaxDictionaryValidationDepth(int maxDictionaryValidationDepth)
protected boolean validateSensitiveDataValue(String fieldName, String fieldValue, String fieldLabel)
public boolean processCompleteDocument(Document document)
processCompleteDocument
in interface CompleteDocumentRule
document
- Documentprotected boolean processCustomCompleteDocumentBusinessRules(Document document)
document
- protected boolean useKimPermission(String namespace, String permissionTemplateName, Map<String,String> permissionDetails)
protected Map<String,String> buildDocumentTypeActionRequestPermissionDetails(DocumentType documentType, String actionRequestCode)
protected Map<String,String> buildDocumentTypePermissionDetails(DocumentType documentType)
protected DataDictionaryService getDataDictionaryService()
protected PersonService getPersonService()
public static GroupService getGroupService()
public static PermissionService getPermissionService()
protected DictionaryValidationService getDictionaryValidationService()
protected ConfigurationService getKualiConfigurationService()
protected static DocumentDictionaryService getDocumentDictionaryService()
public static void setDocumentDictionaryService(DocumentDictionaryService documentDictionaryService)
Copyright © 2005-2015 The Kuali Foundation. All Rights Reserved.