Interface DocumentLifecycleUserActionExecutionOperation
public interface DocumentLifecycleUserActionExecutionOperation
A sequence of instructions that can be chained together, building a document lifecycle user action execution operation
that can be executed with
execute()
.
Supplying a success handler via onSuccess(Consumer)
is optional.
Supplying an error handler via onError(Consumer)
is optional, but errors will throw an exception.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
Executes the user action.onError
(Consumer<DocumentLifecycleUserActionExecutionError> errorHandler) Sets the function called when the user action execution encounters an error.onSuccess
(Consumer<DocumentLifecycleUserActionExecutionResponse> successHandler) Sets the function called when the user action execution succeeds.
-
Method Details
-
onSuccess
DocumentLifecycleUserActionExecutionOperation onSuccess(Consumer<DocumentLifecycleUserActionExecutionResponse> successHandler) Sets the function called when the user action execution succeeds.- Parameters:
successHandler
- function to call after successful execution- Returns:
- this
DocumentLifecycleUserActionExecutionOperation
-
onError
DocumentLifecycleUserActionExecutionOperation onError(Consumer<DocumentLifecycleUserActionExecutionError> errorHandler) Sets the function called when the user action execution encounters an error.- Parameters:
errorHandler
- function to call after execution error- Returns:
- this
DocumentLifecycleUserActionExecutionOperation
-
execute
void execute()Executes the user action.If an error handler is not supplied, then any user-facing errors resulting from subsequent actions that are executed such as state changes, entry criteria validation, or entry actions will be propagated through a thrown RuntimeException.
If an error handler is not supplied and the request does not have the correct permission, or if the parameters are not valid values, or if the required parameters are not set, then a RuntimeException may also be thrown.- Throws:
RuntimeException
- on unexpected errors, or if an error handler is not supplied.
-