Package com.veeva.vault.sdk.api.workflow
Interface WorkflowInstanceService
- All Superinterfaces:
Service
Provides methods to retrieve information for and update workflow instances.
-
Method Summary
Modifier and TypeMethodDescriptionCreates aWorkflowAddParticipantsOperation
, which can be used to add participants to an active workflow based on the providedWorkflowAddParticipantsRequest
.cancelWorkflow
(WorkflowCancelRequest request) Creates aWorkflowCancelOperation
, which can be used to cancel an active workflow based on the providedWorkflowCancelRequest
.Gets the available workflow actions for the provided workflow instance.Retrieves aWorkflowInstance
on the given workflow ID.Retrieves a list of workflow instances on the given search options.getWorkflowItems
(String workflowId) Retrieves aWorkflowItemsResponse
containing the items in the active workflow this action is executing against.getWorkflowParticipantGroups
(String workflowId) Retrieves aWorkflowParticipantGroupResponse
containing workflow participant groups in the given active workflow.newParticipantGroupUpdate
(WorkflowParticipantGroup participantGroup) Creates a newWorkflowParticipantGroupUpdate
to allow membership updates to a participant group.Creates aWorkflowAddParticipantsRequest.Builder
.Creates aWorkflowCancelRequest.Builder
.Creates anWorkflowInstanceCollectionRequest.Builder
.Creates aWorkflowInstanceRequest.Builder
.Creates aWorkflowParticipantInputParameter.Builder
.Creates aWorkflowRemoveItemsRequest.Builder
.Creates aWorkflowReplaceOwnerRequest.Builder
.Creates aWorkflowStartInstanceRequest.Builder
.Creates aWorkflowUpdateDueDateRequest.Builder
.removeItems
(WorkflowRemoveItemsRequest request) Creates aWorkflowRemoveItemsOperation
, which can be used to remove items in an active workflow based on the providedWorkflowRemoveItemsRequest
.Creates aWorkflowReplaceOwnerOperation
, which can be used to replace the owner of an active workflow based on the providedWorkflowReplaceOwnerRequest
.Starts the workflow with the workflow name, list of document IDs or record IDs, and input parameters.void
updateParticipantGroup
(WorkflowParticipantGroupUpdate participantGroupUpdate) Updates a specific participant group for a workflow instance.Creates aWorkflowUpdateDueDateOperation
, which can be used to update the due date of an active workflow based on the providedWorkflowUpdateDueDateRequest
.
-
Method Details
-
newParticipantGroupUpdate
Creates a newWorkflowParticipantGroupUpdate
to allow membership updates to a participant group.- Parameters:
participantGroup
- the participant group that should be updated- Returns:
WorkflowParticipantGroupUpdate
object
-
updateParticipantGroup
Updates a specific participant group for a workflow instance. This method ignores any role restrictions previously configured by the workflow Start step's participant control.This method cannot update participant groups if the Participants control on the Start step is configured with Use roles as participants, Use user reference field as participants, or Use Vault user group as participants.
- Parameters:
participantGroupUpdate
- theWorkflowParticipantGroupUpdate
containing updated membership for a specific participant group
-
newWorkflowStartRequestBuilder
WorkflowStartInstanceRequest.Builder newWorkflowStartRequestBuilder()Creates aWorkflowStartInstanceRequest.Builder
.- Returns:
- a
WorkflowStartInstanceRequest.Builder
-
newWorkflowParticipantInputParameterBuilder
WorkflowParticipantInputParameter.Builder newWorkflowParticipantInputParameterBuilder()Creates aWorkflowParticipantInputParameter.Builder
.- Returns:
- a
WorkflowParticipantInputParameter.Builder
-
startWorkflow
WorkflowStartInstanceOperation<WorkflowStartInstanceResponse> startWorkflow(WorkflowStartInstanceRequest request) Starts the workflow with the workflow name, list of document IDs or record IDs, and input parameters.- Parameters:
request
- theWorkflowStartInstanceRequest
containing the information needed to start the workflow. Requires workflow name, list of document or record IDs, and input parameters. Cannot be null.- Returns:
- a
WorkflowStartInstanceOperation
containing aWorkflowStartInstanceResponse
with the execution status and workflow ID
-
newWorkflowInstanceRequestBuilder
WorkflowInstanceRequest.Builder newWorkflowInstanceRequestBuilder()Creates aWorkflowInstanceRequest.Builder
.- Returns:
- a
WorkflowInstanceRequest.Builder
-
getWorkflowInstance
Retrieves aWorkflowInstance
on the given workflow ID.- Parameters:
request
- theWorkflowInstanceRequest
containing the information needed to retrieve the workflow instance. Requires workflow id.- Returns:
- a
WorkflowInstance
containing workflow details. Throws a runtime exception if the workflow cannot be found.
-
newWorkflowInstanceCollectionRequestBuilder
WorkflowInstanceCollectionRequest.Builder newWorkflowInstanceCollectionRequestBuilder()Creates anWorkflowInstanceCollectionRequest.Builder
.- Returns:
- an
WorkflowInstanceCollectionRequest.Builder
-
getWorkflowInstances
Retrieves a list of workflow instances on the given search options.- Parameters:
request
- theWorkflowInstanceCollectionRequest
containing the information needed to retrieve the list of workflow instances. Cannot be null.- Returns:
- a
WorkflowInstanceCollectionResponse
containing the list of workflow instances
-
getAvailableWorkflowInstanceActions
AvailableWorkflowInstanceActionsResponse getAvailableWorkflowInstanceActions(WorkflowInstanceRequest request) Gets the available workflow actions for the provided workflow instance.- Parameters:
request
- theWorkflowInstanceRequest
containing the information needed to retrieve the available actions for the workflow instance. Requires workflow id.- Returns:
- a
AvailableWorkflowInstanceActionsResponse
containing the available workflow actions.
-
newWorkflowAddParticipantsRequestBuilder
WorkflowAddParticipantsRequest.Builder newWorkflowAddParticipantsRequestBuilder()Creates aWorkflowAddParticipantsRequest.Builder
.- Returns:
- a
WorkflowAddParticipantsRequest.Builder
-
newWorkflowParticipantGroupInputParameterBuilder
WorkflowParticipantGroupInputParameter.Builder newWorkflowParticipantGroupInputParameterBuilder() -
addParticipants
Creates aWorkflowAddParticipantsOperation
, which can be used to add participants to an active workflow based on the providedWorkflowAddParticipantsRequest
. UseWorkflowAddParticipantsOperation.execute()
to add participants to the workflow. For example:workflowInstanceService.addParticipants(workflowAddParticipantsRequest) .onSuccess(response -> { ... }) .onFailure(response -> { ... }) .execute()
- Parameters:
request
- theWorkflowAddParticipantsRequest
containing the information needed to add participants to the workflow. Requires an active workflow, participant group name, and a minimum of one user or group IDs.- Returns:
- a
WorkflowAddParticipantsOperation
, which can be used to add participants to the workflow.
-
newWorkflowCancelRequestBuilder
WorkflowCancelRequest.Builder newWorkflowCancelRequestBuilder()Creates aWorkflowCancelRequest.Builder
.- Returns:
- a
WorkflowCancelRequest.Builder
-
cancelWorkflow
Creates aWorkflowCancelOperation
, which can be used to cancel an active workflow based on the providedWorkflowCancelRequest
.Use
WorkflowCancelOperation.execute()
to cancel the workflow. For example:workflowInstanceService.cancelWorkflow(workflowCancelRequest) .onSuccess(response -> { ... }) .onFailure(response -> { ... }) .execute()
- Parameters:
request
- theWorkflowCancelRequest
containing the information needed to cancel the workflow. Requires an active workflow. Cannot be null.- Returns:
- a
WorkflowCancelOperation
, which can be used to cancel the workflow
-
newWorkflowRemoveItemsRequestBuilder
WorkflowRemoveItemsRequest.Builder newWorkflowRemoveItemsRequestBuilder()Creates aWorkflowRemoveItemsRequest.Builder
.- Returns:
- a
WorkflowRemoveItemsRequest.Builder
-
removeItems
Creates aWorkflowRemoveItemsOperation
, which can be used to remove items in an active workflow based on the providedWorkflowRemoveItemsRequest
. UseWorkflowRemoveItemsOperation.execute()
to remove items in the workflow. For example:workflowInstanceService.removeItems(workflowRemoveItemsRequest) .onSuccess(response -> { ... }) .onFailure(response -> { ... }) .execute()
- Parameters:
request
- theWorkflowRemoveItemsRequest
containing the information needed to remove items in the workflow. Requires an active workflow and a list of document or record IDs.- Returns:
- a
WorkflowRemoveItemsOperation
, which can be used to remove items in the workflow.
-
newWorkflowReplaceOwnerRequestBuilder
WorkflowReplaceOwnerRequest.Builder newWorkflowReplaceOwnerRequestBuilder()Creates aWorkflowReplaceOwnerRequest.Builder
.- Returns:
- a
WorkflowReplaceOwnerRequest.Builder
-
replaceWorkflowOwner
Creates aWorkflowReplaceOwnerOperation
, which can be used to replace the owner of an active workflow based on the providedWorkflowReplaceOwnerRequest
. UseWorkflowReplaceOwnerOperation.execute()
to replace the owner of the workflow. For example:workflowInstanceService.replaceWorkflowOwner(workflowReplaceOwnerRequest) .onSuccess(response -> { ... }) .onFailure(response -> { ... }) .execute()
- Parameters:
request
- theWorkflowReplaceOwnerRequest
containing the information needed to replace the owner of the workflow. Requires an active workflow and the id of the new workflow owner.- Returns:
- a
WorkflowReplaceOwnerOperation
, which can be used to replace the owner of the workflow.
-
newWorkflowUpdateDueDateRequestBuilder
WorkflowUpdateDueDateRequest.Builder newWorkflowUpdateDueDateRequestBuilder()Creates aWorkflowUpdateDueDateRequest.Builder
.- Returns:
- a
WorkflowUpdateDueDateRequest.Builder
-
updateWorkflowDueDate
Creates aWorkflowUpdateDueDateOperation
, which can be used to update the due date of an active workflow based on the providedWorkflowUpdateDueDateRequest
. UseWorkflowUpdateDueDateOperation.execute()
to update the workflow due date and dependent tasks due dates that are based on the workflow due date. For example:workflowInstanceService.updateWorkflowDueDate(workflowUpdateDueDateRequest) .onSuccess(response -> { ... }) .onFailure(response -> { ... }) .execute()
- Parameters:
request
- theWorkflowUpdateDueDateRequest
containing the information needed to update the workflow due date. Requires an active workflow. Cannot be null.- Returns:
- a
WorkflowUpdateDueDateOperation
, which can be used to update the workflow due date.
-
getWorkflowParticipantGroups
Retrieves aWorkflowParticipantGroupResponse
containing workflow participant groups in the given active workflow.- Parameters:
workflowId
- the ID of the active workflow to retrieve workflow participant groups- Returns:
- a
WorkflowParticipantGroupResponse
containing the current workflow participant groups
-
getWorkflowItems
Retrieves aWorkflowItemsResponse
containing the items in the active workflow this action is executing against. Returned values reflect the items in the current transaction right before the call to the action method.- Parameters:
workflowId
- the ID of the active workflow to retrieve workflow items- Returns:
- a
WorkflowItemsResponse
containing the list of workflow items
-