Package com.veeva.vault.sdk.api.workflow
Interface WorkflowStartInstanceOperation<T>
- Type Parameters:
T
- success response object type
public interface WorkflowStartInstanceOperation<T>
A sequence of instructions that can be chained together, building a workflow start execution operation
that can be executed with
execute()
.
Supplying a success handler with onSuccess(Consumer)
is optional.
Supplying a failure handler with onError(Consumer)
is optional, but errors will throw an exception.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
Executes this workflow start operation.onError
(Consumer<WorkflowStartInstanceError> errorHandler) Sets the function called when the workflow start has errors.Sets the function called when the workflow start succeeds.
-
Method Details
-
onSuccess
Sets the function called when the workflow start succeeds.- Parameters:
successHandler
- function to call after successful execution- Returns:
- this
WorkflowStartInstanceOperation
-
onError
Sets the function called when the workflow start has errors.- Parameters:
errorHandler
- function to call after failed execution- Returns:
- this
WorkflowStartInstanceOperation
-
execute
void execute()Executes this workflow start operation.If a failure handler is not supplied, any user-facing errors from subsequent executed actions will be propagated through a RuntimeException.
Without a failure-handler, this method may also throw a RuntimeException if:
- The request does not have the correct permission
- The given parameters are not valid values
- The required parameters are not set
- Throws:
RuntimeException
- if a failure handler is not supplied
-