public class WorkflowDocumentActionsServiceImpl extends Object implements WorkflowDocumentActionsService
WorkflowDocumentActionsService
api.Modifier and Type | Class and Description |
---|---|
protected static interface |
WorkflowDocumentActionsServiceImpl.DocumentActionCallback |
protected static class |
WorkflowDocumentActionsServiceImpl.StandardDocumentActionCallback |
Constructor and Description |
---|
WorkflowDocumentActionsServiceImpl() |
Modifier and Type | Method and Description |
---|---|
DocumentActionResult |
acknowledge(DocumentActionParameters parameters)
Executes an
ActionType.ACKNOWLEDGE action for the given principal and document
specified in the supplied parameters. |
DocumentActionResult |
adHocToGroup(DocumentActionParameters parameters,
AdHocToGroup_v2_1_2 adHocToGroup)
Executes an
ActionType.ADHOC_REQUEST action for the given group and document
specified in the supplied parameters to create an ad hoc action request to the target group
specified in the AdHocToGroup . |
DocumentActionResult |
adHocToGroup(DocumentActionParameters parameters,
AdHocToGroup adHocToGroup)
Executes an
ActionType.ADHOC_REQUEST action for the given group and document
specified in the supplied parameters to create an ad hoc action request to the target group
specified in the AdHocToGroup . |
DocumentActionResult |
adHocToPrincipal(DocumentActionParameters parameters,
AdHocToPrincipal_v2_1_2 adHocToPrincipal)
Executes an
ActionType.ADHOC_REQUEST action for the given principal and document
specified in the supplied parameters to create an ad hoc action request to the target
principal specified in the AdHocToPrincipal . |
DocumentActionResult |
adHocToPrincipal(DocumentActionParameters parameters,
AdHocToPrincipal adHocToPrincipal)
Executes an
ActionType.ADHOC_REQUEST action for the given principal and document
specified in the supplied parameters to create an ad hoc action request to the target
principal specified in the AdHocToPrincipal . |
DocumentActionResult |
approve(DocumentActionParameters parameters)
Executes an
ActionType.APPROVE action for the given principal and document specified
in the supplied parameters. |
DocumentActionResult |
blanketApprove(DocumentActionParameters parameters)
Triggers the execution of a full
ActionType.BLANKET_APPROVE action for the given
principal and document specified in the supplied parameters. |
DocumentActionResult |
blanketApproveToNodes(DocumentActionParameters parameters,
Set<String> nodeNames)
Triggers the execution of a
ActionType.BLANKET_APPROVE action which orchestrates the
document to the given set of node names for the given principal and document specified in the
supplied parameters. |
DocumentActionResult |
cancel(DocumentActionParameters parameters)
Executes a
ActionType.CANCEL action for the given principal and document specified in
the supplied parameters. |
DocumentActionResult |
clearFyi(DocumentActionParameters parameters)
Executes an
ActionType.FYI action for the given principal and document specified in
the supplied parameters. |
DocumentActionResult |
complete(DocumentActionParameters parameters)
Executes an
ActionType.COMPLETE action for the given principal and document specified
in the supplied parameters. |
protected DocumentActionResult |
constructDocumentActionResult(DocumentRouteHeaderValue documentBo,
String principalId) |
Document |
create(String documentTypeName,
String initiatorPrincipalId,
DocumentUpdate documentUpdate,
DocumentContentUpdate documentContentUpdate)
Creates a new document instance from the given document type.
|
Document |
delete(String documentId,
String principalId)
Deletes the document.
|
RequestedActions |
determineRequestedActions(String documentId,
String principalId)
Determines which actions are requested against the document with the given id for the
principal with the given id.
|
protected RequestedActions |
determineRequestedActionsInternal(DocumentRouteHeaderValue documentBo,
String principalId) |
protected boolean |
determineValidActionInternal(String actionTypeCode,
DocumentRouteHeaderValue documentBo,
String principalId) |
ValidActions |
determineValidActions(String documentId,
String principalId)
Determines which actions against the document with the given id are valid for the principal
with the given id.
|
protected ValidActions |
determineValidActionsInternal(DocumentRouteHeaderValue documentBo,
String principalId) |
DocumentActionResult |
disapprove(DocumentActionParameters parameters)
Executes a
ActionType.DISAPPROVE action for the given principal and document
specified in the supplied parameters. |
boolean |
documentWillHaveAtLeastOneActionRequest(RoutingReportCriteria reportCriteria,
List<String> actionRequestedCodes,
boolean ignoreCurrentActionRequests)
Determines if a document has at least one action request
|
protected DocumentActionResult |
executeActionInternal(DocumentActionParameters parameters,
WorkflowDocumentActionsServiceImpl.DocumentActionCallback callback) |
DocumentDetail |
executeSimulation(RoutingReportCriteria reportCriteria)
Executes a simulation of a document to get all previous and future route information
|
List<String> |
getPrincipalIdsInRouteLog(String documentId,
boolean lookFuture)
Returns a list of principal Ids that exist in a route log
|
protected DocumentRouteHeaderValue |
init(DocumentActionParameters parameters) |
void |
initiateIndexing(String documentId)
Initiates the process of document attribute indexing for the document with the given id.
|
boolean |
isFinalApprover(String documentId,
String principalId)
Determines if a passed in user is the final approver for a document
|
boolean |
isLastApproverAtNode(String documentId,
String principalId,
String nodeName)
Determines if a passed in user is the last approver at a specified route node
|
boolean |
isUserInRouteLog(String documentId,
String principalId,
boolean lookFuture)
Determines if a passed in user exists in a document's route log or future route depending on the passed in
lookFuture value |
boolean |
isUserInRouteLogWithOptionalFlattening(String documentId,
String principalId,
boolean lookFuture,
boolean flattenNodes)
Determines if a passed in user exists in a document's route log or future route depending on the passed in
lookFuture value and flattenNodes |
boolean |
isValidAction(String actionTypeCode,
String documentId,
String principalId)
Determines whether the given action is valid for the document and principal id.
|
void |
logAnnotation(String documentId,
String principalId,
String annotation)
Records the non-routed document action.
|
DocumentActionResult |
move(DocumentActionParameters parameters,
MovePoint movePoint)
Triggers the execution of a
ActionType.MOVE action for the given
principal and document specified in the supplied parameters. |
DocumentActionResult |
placeInExceptionRouting(DocumentActionParameters parameters)
Places a document in exception routing or the given principal and document specified in the supplied parameters.
|
DocumentActionResult |
recall(DocumentActionParameters parameters,
boolean cancel)
Executes a
ActionType.RECALL action for the given principal and document specified in
the supplied parameters. |
DocumentActionResult |
releaseGroupAuthority(DocumentActionParameters parameters,
String groupId)
Triggers the execution of a
ActionType.RELEASE_GROUP_AUTHORITY action for the given
principal and document specified in the supplied parameters. |
void |
reResolveRoleByDocTypeName(String documentTypeName,
String roleName,
String qualifiedRoleNameLabel)
Re-resolves the given role for all documents for the given document type (including children).
|
void |
reResolveRoleByDocumentId(String documentId,
String roleName,
String qualifiedRoleNameLabel)
Re-resolves the given role for all documents for the given document id (including children).
|
DocumentActionResult |
returnToPreviousNode(DocumentActionParameters parameters,
ReturnPoint returnPoint)
Triggers the execution of a
ActionType.RETURN_TO_PREVIOUS action for the given
principal and document specified in the supplied parameters. |
DocumentActionResult |
revokeAdHocRequestById(DocumentActionParameters parameters,
String actionRequestId)
Executes an
ActionType.ADHOC_REQUEST_REVOKE action for the given principal and
document specified in the supplied parameters against the action request with the given id. |
DocumentActionResult |
revokeAdHocRequests(DocumentActionParameters parameters,
AdHocRevoke revoke)
Executes an
ActionType.ADHOC_REQUEST_REVOKE action which revokes all pending ad hoc
action requests that match the supplied AdHocRevoke criteria for the given principal
and document specified in the supplied parameters. |
DocumentActionResult |
revokeAllAdHocRequests(DocumentActionParameters parameters)
Executes an
ActionType.ADHOC_REQUEST_REVOKE action which revokes all pending ad hoc
action requests for the given principal and document specified in the supplied parameters. |
DocumentActionResult |
route(DocumentActionParameters parameters)
Submits a document that is in either the "initiated" or "saved" state to the workflow engine
for processing.
|
boolean |
routeNodeHasApproverActionRequest(String documentTypeName,
String docContent,
String nodeName)
Determines if a route node has an 'approve action' request
|
DocumentActionResult |
save(DocumentActionParameters parameters)
Triggers the execution of a
ActionType.SAVE action for the given
principal and document specified in the supplied parameters. |
DocumentActionResult |
saveDocumentData(DocumentActionParameters parameters)
Triggers the execution of a
ActionType.SAVE action for the given
principal and document specified in the supplied parameters. |
void |
setDocumentTypeService(DocumentTypeService documentTypeService) |
DocumentActionResult |
superUserBlanketApprove(DocumentActionParameters parameters,
boolean executePostProcessor)
Triggers the execution of a
ActionType.SU_BLANKET_APPROVE action for the given
principal and document specified in the supplied parameters. |
DocumentActionResult |
superUserCancel(DocumentActionParameters parameters,
boolean executePostProcessor)
Triggers the execution of a
ActionType.SU_CANCEL action for the given
principal and document specified in the supplied parameters. |
DocumentActionResult |
superUserDisapprove(DocumentActionParameters parameters,
boolean executePostProcessor)
Triggers the execution of a
ActionType.SU_DISAPPROVE action for the given
principal and document specified in the supplied parameters. |
DocumentActionResult |
superUserNodeApprove(DocumentActionParameters parameters,
boolean executePostProcessor,
String nodeName)
Triggers the execution of a
ActionType.SU_APPROVE action for the given
principal and document specified in the supplied parameters. |
DocumentActionResult |
superUserReturnToPreviousNode(DocumentActionParameters parameters,
boolean executePostProcessor,
ReturnPoint returnPoint)
Triggers the execution of a
ActionType.SU_RETURN_TO_PREVIOUS action for the given
principal and document specified in the supplied parameters. |
DocumentActionResult |
superUserTakeRequestedAction(DocumentActionParameters parameters,
boolean executePostProcessor,
String actionRequestId)
Triggers the execution of a
ActionType.SU_APPROVE action for the given
actionRequestId and principal and document specified in the supplied parameters. |
DocumentActionResult |
takeGroupAuthority(DocumentActionParameters parameters,
String groupId)
Triggers the execution of a
ActionType.TAKE_GROUP_AUTHORITY action for the given
principal and document specified in the supplied parameters. |
List<RemotableAttributeError> |
validateWorkflowAttributeDefinition(WorkflowAttributeDefinition definition)
Validates a workflow attribute definition and returns a list of validation errors
|
public WorkflowDocumentActionsServiceImpl()
protected DocumentRouteHeaderValue init(DocumentActionParameters parameters)
public Document create(String documentTypeName, String initiatorPrincipalId, DocumentUpdate documentUpdate, DocumentContentUpdate documentContentUpdate) throws RiceIllegalArgumentException, IllegalDocumentTypeException, InvalidActionTakenException
WorkflowDocumentActionsService
DocumentUpdate
and DocumentContentUpdate
parameters can be supplied in order
to create the document with these additional pieces of data already set.
By default, if neither the DocumentUpdate
or DocumentContentUpdate
is passed
to this method, the document that is created and returned from this operation will have the
following initial state:
status
set to DocumentStatus.INITIATED
createDate
and dateLastModified
set to the current date and time
current
set to 'true'
documentContent
set to the default and empty content
Additionally, the initial RouteNodeInstance
for the workflow process on the document
will be created and linked to the document as it's initial node. Once the document is
created, the WorkflowDocumentActionsService.route(DocumentActionParameters)
operation must be invoked in order to
submit it to the workflow engine for initial processing.
In certain situations, the given principal may not be permitted to initiate documents of the
given type. In these cases an InvalidActionTakenException
will be thrown.
create
in interface WorkflowDocumentActionsService
documentTypeName
- the name of the document type from which to create this documentinitiatorPrincipalId
- the id of the principal who is initiating this documentdocumentUpdate
- specifies additional document to set on the document upon creation,
this is optional and if null is passed then the document will be created with the
default document statedocumentContentUpdate
- defines what the initial document content for the document
should be, this is optional if null is passed then the document will be created with
the default empty document contentRiceIllegalArgumentException
- if principalId
is null or blankIllegalDocumentTypeException
- if the specified document type is not activeInvalidActionTakenException
- if the supplied principal is not allowed to execute this
actionpublic ValidActions determineValidActions(String documentId, String principalId)
WorkflowDocumentActionsService
determineValidActions
in interface WorkflowDocumentActionsService
documentId
- the id of the document for which to determine valid actionsprincipalId
- the id of the principal for which to determine valid actions against the
given documentValidActions
object which contains the valid actions for the given
principal against the given documentprotected ValidActions determineValidActionsInternal(DocumentRouteHeaderValue documentBo, String principalId)
public boolean isValidAction(String actionTypeCode, String documentId, String principalId) throws RiceIllegalArgumentException
WorkflowDocumentActionsService
isValidAction
in interface WorkflowDocumentActionsService
actionTypeCode
- type code for the action to checkdocumentId
- the id of the document to check action forprincipalId
- the id of the principal to check permission forRiceIllegalArgumentException
- if actionTypeCode
is null or blankprotected boolean determineValidActionInternal(String actionTypeCode, DocumentRouteHeaderValue documentBo, String principalId)
public RequestedActions determineRequestedActions(String documentId, String principalId)
WorkflowDocumentActionsService
This method is distinguished from WorkflowDocumentActionsService.determineValidActions(String, String)
in that fact
that valid actions are the actions that the principal is permitted to take, while requested
actions are those that the principal is specifically being asked to take. Note that the
actions that are requested are used when assembling valid actions but are not necessarily the
only authoritative source for determination of valid actions for the principal, as
permissions and other configuration can also come into play.
determineRequestedActions
in interface WorkflowDocumentActionsService
documentId
- the id of the document for which to determine requested actionsprincipalId
- the id of the principal for which to determine requested actions against
the given documentRequestedActions
object which contains the actions that are being requested
from the given principal against the given documentprotected RequestedActions determineRequestedActionsInternal(DocumentRouteHeaderValue documentBo, String principalId)
public DocumentDetail executeSimulation(RoutingReportCriteria reportCriteria)
WorkflowDocumentActionsService
executeSimulation
in interface WorkflowDocumentActionsService
reportCriteria
- criteria for the simulation to followprotected DocumentActionResult constructDocumentActionResult(DocumentRouteHeaderValue documentBo, String principalId)
public DocumentActionResult acknowledge(DocumentActionParameters parameters)
WorkflowDocumentActionsService
ActionType.ACKNOWLEDGE
action for the given principal and document
specified in the supplied parameters. When a principal acknowledges a document, any of the
principal's pending action requests at or below the acknowledge level (which includes fyi
requests as well) will be satisfied by the principal's action. The principal's action should
be recorded with the document as an ActionTaken
.
Depending on document type policy, a pending action request at or below the acknowledge level
may have to exist on the document in order for the principal to take this action. Otherwise
an InvalidActionTakenException
may be thrown. In order to determine if an acknowledge
action is valid, the ValidActions
or RequestedActions
for the document can be
checked.
acknowledge
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datapublic DocumentActionResult approve(DocumentActionParameters parameters)
WorkflowDocumentActionsService
ActionType.APPROVE
action for the given principal and document specified
in the supplied parameters. When a principal approves a document, any of the principal's
pending action requests at or below the approve level (which includes complete, acknowledge,
and fyi requests as well) will be satisfied by the principal's action. The principal's action
should be recorded with the document as an ActionTaken
.
Depending on document type policy, a pending action request at or below the approve level may
have to exist on the document in order for the principal to take this action. Otherwise an
InvalidActionTakenException
may be thrown. In order to determine if an approve action
is valid, the ValidActions
or RequestedActions
for the document can be
checked.
approve
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datapublic DocumentActionResult adHocToPrincipal(DocumentActionParameters parameters, AdHocToPrincipal adHocToPrincipal)
WorkflowDocumentActionsService
ActionType.ADHOC_REQUEST
action for the given principal and document
specified in the supplied parameters to create an ad hoc action request to the target
principal specified in the AdHocToPrincipal
.
Operates as per WorkflowDocumentActionsService.adHocToGroup(DocumentActionParameters, AdHocToGroup)
with the
exception that this method is used to send an adhoc request to principal instead of a group.
Besides this difference, the same rules that are in play for sending ad hoc requests to group apply for sending ad hoc requests to principals.
adHocToPrincipal
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document dataadHocToPrincipal
- defines various pieces of information that informs what type of ad
hoc request should be createdWorkflowDocumentActionsService.adHocToGroup(DocumentActionParameters, AdHocToGroup)
public DocumentActionResult adHocToPrincipal(DocumentActionParameters parameters, AdHocToPrincipal_v2_1_2 adHocToPrincipal)
WorkflowDocumentActionsService
ActionType.ADHOC_REQUEST
action for the given principal and document
specified in the supplied parameters to create an ad hoc action request to the target
principal specified in the AdHocToPrincipal
.
Operates as per WorkflowDocumentActionsService.adHocToGroup(DocumentActionParameters, AdHocToGroup)
with the
exception that this method is used to send an adhoc request to principal instead of a group.
Besides this difference, the same rules that are in play for sending ad hoc requests to group apply for sending ad hoc requests to principals.
adHocToPrincipal
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document dataadHocToPrincipal
- defines various pieces of information that informs what type of ad
hoc request should be createdWorkflowDocumentActionsService.adHocToGroup(DocumentActionParameters, AdHocToGroup)
public DocumentActionResult adHocToGroup(DocumentActionParameters parameters, AdHocToGroup adHocToGroup)
WorkflowDocumentActionsService
ActionType.ADHOC_REQUEST
action for the given group and document
specified in the supplied parameters to create an ad hoc action request to the target group
specified in the AdHocToGroup
. The AdHocToGroup
contains additional
information on how the ad hoc action request should be created, including the type of request
to generate, at which node it should generated, etc.
The policy for how ad hoc actions handle request generation and interact with the workflow
engine is different depending on the state of the document when the request to generate the
ad hoc is submitted. There are also different scenarios under which certain types of ad hoc
actions are allowed to be executed (throwing InvalidActionTakenException
in
situations where the actions are not permitted). The rules are defined as follows:
DocumentStatus.INITIATED
then the action request
will be generated with a status of ActionRequestStatus.INITIALIZED
and no processing
directives will be submitted to the workflow engine. When the document is routed, these ad
hoc requests will get activatedActionRequestType.COMPLETE
or
ActionRequestType.APPROVE
and the document is in a "terminal" state (either
DocumentStatus.CANCELED
, DocumentStatus.DISAPPROVED
,
DocumentStatus.PROCESSED
, DocumentStatus.FINAL
) or is in
DocumentStatus.EXCEPTION
status, then an InvalidActionTakenException
will be
thrown. This is because submitting such an action with a document in that state would result
in creation of an illegal action request.ActionRequestStatus.INITIALIZED
status, and the document will be immediately
forwarded to the workflow engine for processing at which point the ad hoc request will
activated at the appropriate time.
Unlink other actions, ad hoc actions don't result in the recording of an ActionTaken
against the document. Instead, only the requested ad hoc ActionRequest
is created.
adHocToGroup
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document dataadHocToGroup
- defines various pieces of information that informs what type of ad hoc
request should be createdpublic DocumentActionResult adHocToGroup(DocumentActionParameters parameters, AdHocToGroup_v2_1_2 adHocToGroup)
WorkflowDocumentActionsService
ActionType.ADHOC_REQUEST
action for the given group and document
specified in the supplied parameters to create an ad hoc action request to the target group
specified in the AdHocToGroup
. The AdHocToGroup
contains additional
information on how the ad hoc action request should be created, including the type of request
to generate, at which node it should generated, etc.
The policy for how ad hoc actions handle request generation and interact with the workflow
engine is different depending on the state of the document when the request to generate the
ad hoc is submitted. There are also different scenarios under which certain types of ad hoc
actions are allowed to be executed (throwing InvalidActionTakenException
in
situations where the actions are not permitted). The rules are defined as follows:
DocumentStatus.INITIATED
then the action request
will be generated with a status of ActionRequestStatus.INITIALIZED
and no processing
directives will be submitted to the workflow engine. When the document is routed, these ad
hoc requests will get activatedActionRequestType.COMPLETE
or
ActionRequestType.APPROVE
and the document is in a "terminal" state (either
DocumentStatus.CANCELED
, DocumentStatus.DISAPPROVED
,
DocumentStatus.PROCESSED
, DocumentStatus.FINAL
) or is in
DocumentStatus.EXCEPTION
status, then an InvalidActionTakenException
will be
thrown. This is because submitting such an action with a document in that state would result
in creation of an illegal action request.ActionRequestStatus.INITIALIZED
status, and the document will be immediately
forwarded to the workflow engine for processing at which point the ad hoc request will
activated at the appropriate time.
Unlink other actions, ad hoc actions don't result in the recording of an ActionTaken
against the document. Instead, only the requested ad hoc ActionRequest
is created.
adHocToGroup
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document dataadHocToGroup
- defines various pieces of information that informs what type of ad hoc
request should be createdpublic DocumentActionResult revokeAdHocRequestById(DocumentActionParameters parameters, String actionRequestId)
WorkflowDocumentActionsService
ActionType.ADHOC_REQUEST_REVOKE
action for the given principal and
document specified in the supplied parameters against the action request with the given id.
The process of revoking an ad hoc request simply deactivates the request associating the
generated ActionTaken
of the revoke action with the deactivated request (this allows
for it to be determined what caused the ad hoc request to be deactivated). As with other
actions, this action taken is then recorded with the document.revokeAdHocRequestById
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document dataactionRequestId
- the id of the action request to revokepublic DocumentActionResult revokeAdHocRequests(DocumentActionParameters parameters, AdHocRevoke revoke)
WorkflowDocumentActionsService
ActionType.ADHOC_REQUEST_REVOKE
action which revokes all pending ad hoc
action requests that match the supplied AdHocRevoke
criteria for the given principal
and document specified in the supplied parameters. The process of revoking an ad hoc requests
simply deactivates all ad hoc requests that match the given AdHocRevoke
criteria,
associating the generated ActionTaken
of the revoke action with the deactivated
requests (this allows for it to be determined what caused the ad hoc request to be
deactivated). As with other actions, this action taken is then recorded with the document.
It's possible that the given ad hoc revoke command will match no action requests on the document, in which case this method will complete successfully but no requests will be deactivated.
revokeAdHocRequests
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datarevoke
- the criteria for matching ad hoc action requests on the specified document that
should be revokedpublic DocumentActionResult revokeAllAdHocRequests(DocumentActionParameters parameters)
WorkflowDocumentActionsService
ActionType.ADHOC_REQUEST_REVOKE
action which revokes all pending ad hoc
action requests for the given principal and document specified in the supplied parameters.
This process of revoking all ad hoc requests will simply deactivate all ad hoc requests on
the specified document, associating the generated ActionTaken
of the revoke action
with the deactivated requests (this allows for it to be determined what caused the ad hoc
request to be deactivated). As with other actions, this action taken is then recorded with
the document.
It's possible that the specified document will have no pending adhoc requests, in which case this method will complete successfully but no requests will be deactivated.
revokeAllAdHocRequests
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datapublic DocumentActionResult cancel(DocumentActionParameters parameters)
WorkflowDocumentActionsService
ActionType.CANCEL
action for the given principal and document specified in
the supplied parameters. When a principal cancels a document, all pending action requests on
the document are deactivated and the the principal's action will be recorded on the document
as an ActionTaken
. Additionally, the document will be (synchronously) transitioned to
the DocumentStatus.CANCELED
status.
In order to cancel a document, the principal must have permission to cancel documents of the appropriate type, and one of the following must hold true:
DocumentStatus.INITIATED
orDocumentStatus.SAVED
orcancel
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datapublic DocumentActionResult recall(DocumentActionParameters parameters, boolean cancel)
WorkflowDocumentActionsService
ActionType.RECALL
action for the given principal and document specified in
the supplied parameters. When a principal cancels a document, all pending action requests on
the document are deactivated and the the principal's action will be recorded on the document
as an ActionTaken
. Additionally, the document will be (synchronously) transitioned to
the DocumentStatus.RECALLED
status.
TODO: FILL IN DOCS FOR RECALL ACTION
In order to cancel a document, the principal must have permission to cancel documents of the appropriate type, and one of the following must hold true:
DocumentStatus.INITIATED
orDocumentStatus.SAVED
orrecall
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datacancel
- whether to recall & cancel or recall & return to action listpublic DocumentActionResult clearFyi(DocumentActionParameters parameters)
WorkflowDocumentActionsService
ActionType.FYI
action for the given principal and document specified in
the supplied parameters. When a principal clears fyis on a document, any of the principal's
pending fyis will be satisfied by the principal's action. The principal's action should be
recorded with the document as an ActionTaken
.
Depending on document type policy, a pending fyi request may have to exist on the document in
order for the principal to take this action. Otherwise an InvalidActionTakenException
may be thrown. In order to determine if an fyi action is valid, the ValidActions
or
RequestedActions
for the document can be checked.
clearFyi
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datapublic DocumentActionResult complete(DocumentActionParameters parameters)
WorkflowDocumentActionsService
ActionType.COMPLETE
action for the given principal and document specified
in the supplied parameters. When a principal completes a document, any of the principal's
pending action requests at or below the complete level (which includes approve, acknowledge,
and fyi requests as well) will be satisfied by the principal's action. The principal's action
should be recorded with the document as an ActionTaken
.
Depending on document type policy, a pending action request at or below the complete level
may have to exist on the document in order for the principal to take this action. Otherwise
an InvalidActionTakenException
may be thrown. In order to determine if an complete
action is valid, the ValidActions
or RequestedActions
for the document can be
checked.
complete
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datapublic DocumentActionResult disapprove(DocumentActionParameters parameters)
WorkflowDocumentActionsService
ActionType.DISAPPROVE
action for the given principal and document
specified in the supplied parameters. When a principal disapproves a document, all pending
action requests on the document are deactivated and the the principal's action will be
recorded on the document as an ActionTaken
. Additionally, the document will be
(synchronously) transitioned to the DocumentStatus.DISAPPROVED
status.
Depending on document type policy and configuration, notifications may be sent to past approvers of the document. By default, an "acknowledge" request will be sent to each principal who took an "approve" or "complete" action on the document previously.
In order to disapprove a document, the principal must have a pending approve or complete request on the document.
disapprove
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datapublic DocumentActionResult route(DocumentActionParameters parameters)
WorkflowDocumentActionsService
DocumentStatus.ENROUTE
. It
then queues up a request to the workflow engine to process the document.
When the route action is executed, an ActionType.COMPLETE
action is recorded on the
document for the principal who executed the route action. At this point in time, any action
requests that are currently on the document in an "initialized" state will be activated.
Requests of this nature can commonly exist if ad hoc requests have been attached to the
document prior to execution of the route action.
By default, the principal who initiated the document is the same principal who must submit the route command. However, a document type policy can be set which will relax this constraint.
The route action should ideally only ever be executed once for a given document. Depending on
document type policy, attempting to execute a "route" action against a document which is
already enroute or in a terminal state may result in an InvalidActionTakenException
being thrown.
route
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datapublic DocumentActionResult blanketApprove(DocumentActionParameters parameters)
WorkflowDocumentActionsService
ActionType.BLANKET_APPROVE
action for the given
principal and document specified in the supplied parameters. Blanket approval will
orchestrate a document from it's current node all the way to the end of the document's
workflow process. During this process, it will automatically act on all "approve" and
"complete" requests, effectively bypassing them. When it does this, it will notify the
original recipients of these requests by routing acknowledge requests to them.
Blanket approve processing is handled by a special mode of the workflow engine which runs the document through it's full processing lifecycle, ensuring that it makes it's way to the end of it's route path (by bypassing any steps that would cause the process to halt, such as approval requests). Because of this nature, blanket approve processing behavior is governed by the same configuration as the rest of the workflow engine. So depending on whether the engine is configured or synchronous or asynchronous operation, the blanket approve processing will behave in the same manner.
In order to execute a blanket approve operation, the principal must have permissions to do so.
blanketApprove
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datapublic DocumentActionResult blanketApproveToNodes(DocumentActionParameters parameters, Set<String> nodeNames)
WorkflowDocumentActionsService
ActionType.BLANKET_APPROVE
action which orchestrates the
document to the given set of node names for the given principal and document specified in the
supplied parameters. This method functions the same as
WorkflowDocumentActionsService.blanketApprove(DocumentActionParameters)
with the exception that the blanket approve
process will be halted once all node names in the given set have been reached.
If null or an empty set is passed for nodeNames
on this method, it's behavior will be
equivalent to WorkflowDocumentActionsService.blanketApprove(DocumentActionParameters)
.
blanketApproveToNodes
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datanodeNames
- a set of node names to which to blanket approve the given documentpublic DocumentActionResult returnToPreviousNode(DocumentActionParameters parameters, ReturnPoint returnPoint)
WorkflowDocumentActionsService
ActionType.RETURN_TO_PREVIOUS
action for the given
principal and document specified in the supplied parameters. Return a document to a previous
node will allow for the document to be pushed back to an earlier node in the process based on
the criteria present in the ReturnPoint
that is passed to this method.
The document is synchronously returned to the suggested return point (assuming the desired return point can be identified for the given document), and then the document will be submitted to the engine for further processing (effectively, re-establishing the flow of the document from the target return point).
Return the document to the first node in the document is treated as a special case and, rather then transitioning the document back to the "initiated" status, will route a "complete" request to the initiator of the document. The effectively enacts a return to the document initiator in these cases.
returnToPreviousNode
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datapublic DocumentActionResult move(DocumentActionParameters parameters, MovePoint movePoint)
WorkflowDocumentActionsService
ActionType.MOVE
action for the given
principal and document specified in the supplied parameters. Move a document to a
node will allow for the document to be pushed to a different node in the process based on
the criteria present in the MovePoint
that is passed to this method.
The document is synchronously moved to the suggested move point (assuming the desired
move point can be identified for the given document), and then the document will be
submitted to the engine for further processing (effectively, re-establishing the flow of the
document from the target return point).move
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datamovePoint
- the point to move the documentpublic DocumentActionResult takeGroupAuthority(DocumentActionParameters parameters, String groupId)
WorkflowDocumentActionsService
ActionType.TAKE_GROUP_AUTHORITY
action for the given
principal and document specified in the supplied parameters. Takes authority of a group by a
member of that group.takeGroupAuthority
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datagroupId
- the group id to take authority ofpublic DocumentActionResult releaseGroupAuthority(DocumentActionParameters parameters, String groupId)
WorkflowDocumentActionsService
ActionType.RELEASE_GROUP_AUTHORITY
action for the given
principal and document specified in the supplied parameters. Releases authority of a group by a
member of that group.releaseGroupAuthority
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datagroupId
- the group id to take authority ofpublic DocumentActionResult save(DocumentActionParameters parameters)
WorkflowDocumentActionsService
ActionType.SAVE
action for the given
principal and document specified in the supplied parameters. Saves a document to a
at the current point.save
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datapublic DocumentActionResult saveDocumentData(DocumentActionParameters parameters)
WorkflowDocumentActionsService
ActionType.SAVE
action for the given
principal and document specified in the supplied parameters. Saves the current document data for
the document. Note that passing an annotation to this will have no effect because it is not
recorded in the route logsaveDocumentData
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datapublic Document delete(String documentId, String principalId)
WorkflowDocumentActionsService
delete
in interface WorkflowDocumentActionsService
documentId
- the unique id of the document to deletepublic void logAnnotation(String documentId, String principalId, String annotation)
WorkflowDocumentActionsService
logAnnotation
in interface WorkflowDocumentActionsService
documentId
- the unique id of the document to deletepublic void initiateIndexing(String documentId)
WorkflowDocumentActionsService
initiateIndexing
in interface WorkflowDocumentActionsService
documentId
- the unique id of the document for which to initiate indexingpublic DocumentActionResult superUserBlanketApprove(DocumentActionParameters parameters, boolean executePostProcessor)
WorkflowDocumentActionsService
ActionType.SU_BLANKET_APPROVE
action for the given
principal and document specified in the supplied parameters. Does a blanket approve for a super user
and runs post-processing depending on executePostProcessor
superUserBlanketApprove
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document dataexecutePostProcessor
- boolean value determining if the post-processor should be run or notpublic DocumentActionResult superUserNodeApprove(DocumentActionParameters parameters, boolean executePostProcessor, String nodeName)
WorkflowDocumentActionsService
ActionType.SU_APPROVE
action for the given
principal and document specified in the supplied parameters. Does an approve for a super user
on a node and runs post-processing depending on executePostProcessor
superUserNodeApprove
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document dataexecutePostProcessor
- boolean value determining if the post-processor should be run or notpublic DocumentActionResult superUserTakeRequestedAction(DocumentActionParameters parameters, boolean executePostProcessor, String actionRequestId)
WorkflowDocumentActionsService
ActionType.SU_APPROVE
action for the given
actionRequestId and principal and document specified in the supplied parameters. Does an approve for a super user
on a node and runs post-processing depending on executePostProcessor
superUserTakeRequestedAction
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document dataexecutePostProcessor
- boolean value determining if the post-processor should be run or notactionRequestId
- unique Id of an action request to take action onpublic DocumentActionResult superUserDisapprove(DocumentActionParameters parameters, boolean executePostProcessor)
WorkflowDocumentActionsService
ActionType.SU_DISAPPROVE
action for the given
principal and document specified in the supplied parameters. Does a disapprove for a super user
on a node and runs post-processing depending on executePostProcessor
superUserDisapprove
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document dataexecutePostProcessor
- boolean value determining if the post-processor should be run or notpublic DocumentActionResult superUserCancel(DocumentActionParameters parameters, boolean executePostProcessor)
WorkflowDocumentActionsService
ActionType.SU_CANCEL
action for the given
principal and document specified in the supplied parameters. Does an cancel for a super user
on a node and runs post-processing depending on executePostProcessor
superUserCancel
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document dataexecutePostProcessor
- boolean value determining if the post-processor should be run or notpublic DocumentActionResult superUserReturnToPreviousNode(DocumentActionParameters parameters, boolean executePostProcessor, ReturnPoint returnPoint)
WorkflowDocumentActionsService
ActionType.SU_RETURN_TO_PREVIOUS
action for the given
principal and document specified in the supplied parameters. Returns the document to the
previous node for a super user on a node and runs post-processing depending on executePostProcessor
superUserReturnToPreviousNode
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document dataexecutePostProcessor
- boolean value determining if the post-processor should be run or notreturnPoint
- point to return topublic DocumentActionResult placeInExceptionRouting(DocumentActionParameters parameters)
WorkflowDocumentActionsService
placeInExceptionRouting
in interface WorkflowDocumentActionsService
parameters
- the parameters which indicate which principal is executing the action
against which document, as well as additional operations to take against the document,
such as updating document datapublic boolean documentWillHaveAtLeastOneActionRequest(RoutingReportCriteria reportCriteria, List<String> actionRequestedCodes, boolean ignoreCurrentActionRequests)
WorkflowDocumentActionsService
documentWillHaveAtLeastOneActionRequest
in interface WorkflowDocumentActionsService
reportCriteria
- criteria for routing reportactionRequestedCodes
- list of action request codes to see if they exist for the documentignoreCurrentActionRequests
- boolean value to determine if current action requests should be ignoredpublic void reResolveRoleByDocTypeName(String documentTypeName, String roleName, String qualifiedRoleNameLabel)
WorkflowDocumentActionsService
reResolveRoleByDocTypeName
in interface WorkflowDocumentActionsService
documentTypeName
- documentTypeName of DocuemntType for roleroleName
- name of Role to reresolvequalifiedRoleNameLabel
- qualified role name labelpublic void reResolveRoleByDocumentId(String documentId, String roleName, String qualifiedRoleNameLabel)
WorkflowDocumentActionsService
reResolveRoleByDocumentId
in interface WorkflowDocumentActionsService
documentId
- documentId of Docuemnt for roleroleName
- name of Role to reresolvequalifiedRoleNameLabel
- qualified role name labelpublic List<RemotableAttributeError> validateWorkflowAttributeDefinition(WorkflowAttributeDefinition definition)
WorkflowDocumentActionsService
validateWorkflowAttributeDefinition
in interface WorkflowDocumentActionsService
definition
- WorkflowAttributeDefinition to validatedefinition
public boolean isFinalApprover(String documentId, String principalId)
WorkflowDocumentActionsService
isFinalApprover
in interface WorkflowDocumentActionsService
documentId
- unique Id of the documentprincipalId
- unique Id of Principal to look for in document's route logpublic boolean routeNodeHasApproverActionRequest(String documentTypeName, String docContent, String nodeName)
WorkflowDocumentActionsService
routeNodeHasApproverActionRequest
in interface WorkflowDocumentActionsService
documentTypeName
- document type of documentdocContent
- string representing content of documentnodeName
- name of route node to determine if approve action request existspublic boolean isLastApproverAtNode(String documentId, String principalId, String nodeName)
WorkflowDocumentActionsService
isLastApproverAtNode
in interface WorkflowDocumentActionsService
documentId
- unique Id of the documentprincipalId
- unique Id of Principal to look for in document's route lognodeName
- name of route node to determine last approver forpublic boolean isUserInRouteLog(String documentId, String principalId, boolean lookFuture)
WorkflowDocumentActionsService
lookFuture
valueisUserInRouteLog
in interface WorkflowDocumentActionsService
documentId
- unique Id of documentprincipalId
- unique Id of Principal to look for in document's route loglookFuture
- boolean value determines whether or not to look at the future route logpublic boolean isUserInRouteLogWithOptionalFlattening(String documentId, String principalId, boolean lookFuture, boolean flattenNodes)
WorkflowDocumentActionsService
lookFuture
value and flattenNodes
isUserInRouteLogWithOptionalFlattening
in interface WorkflowDocumentActionsService
documentId
- unique Id of documentprincipalId
- unique Id of Principal to look for in document's route loglookFuture
- boolean value determines whether or not to look at the future route logpublic List<String> getPrincipalIdsInRouteLog(String documentId, boolean lookFuture)
WorkflowDocumentActionsService
getPrincipalIdsInRouteLog
in interface WorkflowDocumentActionsService
documentId
- unique id of the document to get the route log forlookFuture
- boolean value that determines if the method should look at future action requestspublic void setDocumentTypeService(DocumentTypeService documentTypeService)
protected DocumentActionResult executeActionInternal(DocumentActionParameters parameters, WorkflowDocumentActionsServiceImpl.DocumentActionCallback callback)
Copyright © 2005–2015 The Kuali Foundation. All rights reserved.