Package com.veeva.vault.sdk.api.workflow
Interface WorkflowCompleteJobStepOperation
public interface WorkflowCompleteJobStepOperation
A sequence of instructions that can be chained together, building a workflow complete job step 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 TypeMethodDescriptionvoidexecute()Executes this workflow complete job step operation.onError(Consumer<WorkflowActionError> errorHandler) Sets the function to be called when the workflow complete job step action has errors.onSuccess(Consumer<WorkflowCompleteJobStepResponse> successHandler) Sets the function to be called when the workflow complete job step action succeeds.
-
Method Details
-
onSuccess
WorkflowCompleteJobStepOperation onSuccess(Consumer<WorkflowCompleteJobStepResponse> successHandler) Sets the function to be called when the workflow complete job step action succeeds.- Parameters:
successHandler- function to call after successful execution- Returns:
- this
WorkflowCompleteJobStepOperation
-
onError
Sets the function to be called when the workflow complete job step action has errors.- Parameters:
errorHandler- function to call after failed execution- Returns:
- this
WorkflowCompleteJobStepOperation
-
execute
void execute()Executes this workflow complete job step 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
-