Package org.kuali.rice.kew.actions
Class ActionTakenEvent
java.lang.Object
org.kuali.rice.kew.actions.ActionTakenEvent
- Direct Known Subclasses:
AcknowledgeAction,AdHocAction,ApproveAction,BlanketApproveAction,CancelAction,ClearFYIAction,CompleteAction,DisapproveAction,LogDocumentActionAction,MoveDocumentAction,ReleaseWorkgroupAuthority,ReturnToPreviousNodeAction,RevokeAdHocAction,RouteDocumentAction,SaveActionEvent,SuperUserActionRequestApproveEvent,SuperUserApproveEvent,SuperUserCancelEvent,SuperUserDisapproveEvent,SuperUserNodeApproveEvent,SuperUserReturnToPreviousNodeAction,TakeWorkgroupAuthority
Super class containing mostly often used methods by all actions. Holds common
state as well,
DocumentRouteHeaderValue document,
ActionTakenValue action taken (once saved), PrincipalContract principal
that has taken the action- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected static final StringDefault annotation - none.protected static final booleanDefault value for queueing document after the action is recordedprotected static final booleanDefault value for running postprocessor logic after the action is recorded.protected DocumentRouteHeaderValueThis is in spirit immutable, however for expediency it is mutable as at least one action (ReturnToPreviousNodeAction) attempts to reload the route header after every pp notification. -
Constructor Summary
ConstructorsConstructorDescriptionActionTakenEvent(String actionTakenCode, DocumentRouteHeaderValue routeHeader, org.kuali.rice.kim.api.identity.principal.PrincipalContract principal) ActionTakenEvent(String actionTakenCode, DocumentRouteHeaderValue routeHeader, org.kuali.rice.kim.api.identity.principal.PrincipalContract principal, String annotation) ActionTakenEvent(String actionTakenCode, DocumentRouteHeaderValue routeHeader, org.kuali.rice.kim.api.identity.principal.PrincipalContract principal, String annotation, boolean runPostProcessorLogic) ActionTakenEvent(String actionTakenCode, DocumentRouteHeaderValue routeHeader, org.kuali.rice.kim.api.identity.principal.PrincipalContract principal, String annotation, boolean runPostProcessorLogic, boolean queueDocumentAfterAction) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<ActionRequestValue> filterActionRequestsByCode(List<ActionRequestValue> actionRequests, String requestCode) Filters action requests based on if they occur after the given requestCode, and if they relate to this event's principalprotected RecipientfindDelegatorForActionRequests(List actionRequests) Returns the highest priority delegator in the list of action requests.protected voidgenerateAcknowledgementsToPreviousActionTakers(RouteNodeInstance notificationNodeInstance) Utility for generating Acknowledgements to previous document action takers.protected StringCode of the action performed by the user Method may be overridden is action performed will be different than action takenprotected Stringprotected org.kuali.rice.kim.api.identity.principal.PrincipalContractprotected DocumentRouteHeaderValueprotected voidinvokePostProcessor(String message, Callable<org.kuali.rice.kew.framework.postprocessor.ProcessDocReport> invocation) Wraps PostProcessor invocation with error handlingprotected booleanisActionCompatibleRequest(List<ActionRequestValue> requests) protected booleanValidates whether or not this action is valid for the given principal and DocumentRouteHeaderValue.protected static booleanisPolicySet(DocumentType docType, DocumentTypePolicy policy) Determines whether a specific policy is set on the document type.protected static booleanisPolicySet(DocumentType docType, DocumentTypePolicy policy, boolean deflt) Determines whether a specific policy is set on the document type.protected booleanprotected voidnotifyActionTaken(ActionTakenValue actionTaken) protected voidnotifyAfterActionTaken(ActionTakenValue actionTaken) protected voidnotifyStatusChange(String newStatusCode, String oldStatusCode) voidprotected voidAsynchronously queues the documented to be processed by the workflow engine.protected abstract voidprotected ActionTakenValueprotected ActionTakenValuesaveActionTaken(Boolean currentInd) protected ActionTakenValuesaveActionTaken(Boolean currentInd, Recipient delegator) protected ActionTakenValuesaveActionTaken(Recipient delegator) protected voidsetActionTakenCode(String string) protected voidsetRouteHeader(DocumentRouteHeaderValue routeHeader) protected voidabstract StringPlaceholder for validation rules for each actionprotected abstract StringvalidateActionRules(List<ActionRequestValue> actionRequests)
-
Field Details
-
DEFAULT_QUEUE_DOCUMENT_AFTER_ACTION
protected static final boolean DEFAULT_QUEUE_DOCUMENT_AFTER_ACTIONDefault value for queueing document after the action is recorded- See Also:
-
DEFAULT_RUN_POSTPROCESSOR_LOGIC
protected static final boolean DEFAULT_RUN_POSTPROCESSOR_LOGICDefault value for running postprocessor logic after the action is recorded. Inspected when queueing document processing and notifying postprocessors of action taken and doc status change- See Also:
-
DEFAULT_ANNOTATION
Default annotation - none. -
annotation
-
routeHeader
This is in spirit immutable, however for expediency it is mutable as at least one action (ReturnToPreviousNodeAction) attempts to reload the route header after every pp notification.
-
-
Constructor Details
-
ActionTakenEvent
public ActionTakenEvent(String actionTakenCode, DocumentRouteHeaderValue routeHeader, org.kuali.rice.kim.api.identity.principal.PrincipalContract principal) -
ActionTakenEvent
public ActionTakenEvent(String actionTakenCode, DocumentRouteHeaderValue routeHeader, org.kuali.rice.kim.api.identity.principal.PrincipalContract principal, String annotation) -
ActionTakenEvent
public ActionTakenEvent(String actionTakenCode, DocumentRouteHeaderValue routeHeader, org.kuali.rice.kim.api.identity.principal.PrincipalContract principal, String annotation, boolean runPostProcessorLogic) -
ActionTakenEvent
public ActionTakenEvent(String actionTakenCode, DocumentRouteHeaderValue routeHeader, org.kuali.rice.kim.api.identity.principal.PrincipalContract principal, String annotation, boolean runPostProcessorLogic, boolean queueDocumentAfterAction)
-
-
Method Details
-
getActionRequestService
-
getRouteHeader
-
setRouteHeader
-
getPrincipal
protected org.kuali.rice.kim.api.identity.principal.PrincipalContract getPrincipal() -
getActionPerformedCode
Code of the action performed by the user Method may be overridden is action performed will be different than action taken- Returns:
-
isActionValid
protected boolean isActionValid()Validates whether or not this action is valid for the given principal and DocumentRouteHeaderValue. -
isPolicySet
protected static boolean isPolicySet(DocumentType docType, DocumentTypePolicy policy, boolean deflt) Determines whether a specific policy is set on the document type.- Parameters:
docType- the document typepolicy- the DocumentTypePolicydeflt- the default value if the policy is not present- Returns:
- the policy value or deflt if missing
-
isPolicySet
Determines whether a specific policy is set on the document type.- Parameters:
docType- the document typepolicy- the DocumentTypePolicy- Returns:
- the policy value or false if missing
-
validateActionRules
Placeholder for validation rules for each action- Returns:
- error message string of specific error message
-
validateActionRules
-
filterActionRequestsByCode
protected List<ActionRequestValue> filterActionRequestsByCode(List<ActionRequestValue> actionRequests, String requestCode) Filters action requests based on if they occur after the given requestCode, and if they relate to this event's principal- Parameters:
actionRequests- the List of ActionRequestValues to filterrequestCode- the request code for all ActionRequestValues to be after- Returns:
- the filtered List of ActionRequestValues
-
isActionCompatibleRequest
-
performAction
- Throws:
InvalidActionTakenException
-
recordAction
- Throws:
InvalidActionTakenException
-
updateSearchableAttributesIfPossible
protected void updateSearchableAttributesIfPossible() -
invokePostProcessor
protected void invokePostProcessor(String message, Callable<org.kuali.rice.kew.framework.postprocessor.ProcessDocReport> invocation) Wraps PostProcessor invocation with error handling- Parameters:
message- log messageinvocation- the callable that invokes the postprocessor
-
notifyActionTaken
-
notifyAfterActionTaken
-
notifyStatusChange
protected void notifyStatusChange(String newStatusCode, String oldStatusCode) throws InvalidActionTakenException - Throws:
InvalidActionTakenException
-
queueDocumentProcessing
protected void queueDocumentProcessing()Asynchronously queues the documented to be processed by the workflow engine. -
saveActionTaken
-
saveActionTaken
-
saveActionTaken
-
saveActionTaken
-
findDelegatorForActionRequests
Returns the highest priority delegator in the list of action requests. -
getActionTakenCode
-
setActionTakenCode
-
getDocumentId
-
isRunPostProcessorLogic
protected boolean isRunPostProcessorLogic() -
getGroupIdsForPrincipal
-
generateAcknowledgementsToPreviousActionTakers
protected void generateAcknowledgementsToPreviousActionTakers(RouteNodeInstance notificationNodeInstance) Utility for generating Acknowledgements to previous document action takers. Note that in constrast with other notification-generation methods (such as those in ActionRequestFactory) this method determines its recipient list from ActionTakenValues, not from outstanding ActionRequests.- Parameters:
notificationNodeInstance- the node instance with which generated actionrequests will be associated- See Also:
-