Interface WorkflowInstanceOperator
- All Known Subinterfaces:
WorkflowInstance,WorkflowInstances,WorkflowInstances.Single
public interface WorkflowInstanceOperator
Provides operations for requesting lifecycle changes to a workflow instance.
Cancellation is cooperative: a request does not forcibly terminate user code. Cancelling a step makes its pending
result complete with a StepCancellationException. Cancelling a workflow wakes its execution, which then
terminates with a WorkflowCancelledException. Workflow code can catch these signals to release resources, but
should let cancellation continue rather than treating it as successful completion. User code that does not reach a
framework-controlled cancellation point is not forcibly stopped.
- Since:
- 5.4.0
- Author:
- Simon Zambrovski
-
Method Summary
Modifier and TypeMethodDescriptionrequestCancellationOfAllSteps(@Nullable Throwable cause) Requests cooperative cancellation of every currently running step without terminating the workflow.requestStepCancellation(String stepName, @Nullable Throwable cause) Requests cooperative cancellation of one workflow step.requestWorkflowCancellation(@Nullable Throwable cause) Requests cancellation of the workflow.
-
Method Details
-
requestStepCancellation
Requests cooperative cancellation of one workflow step.- Parameters:
stepName- name of the step to cancelcause- optional reason for the cancellation- Returns:
- future completing with
truewhen a terminal step cancellation was recorded, orfalsewhen the step was unknown or already terminal
-
requestCancellationOfAllSteps
Requests cooperative cancellation of every currently running step without terminating the workflow.- Parameters:
cause- optional reason for the cancellation- Returns:
- future completing with the number of steps for which terminal cancellation was recorded
-
requestWorkflowCancellation
Requests cancellation of the workflow.- Parameters:
cause- optional reason for the cancellation- Returns:
- future completing after the workflow cancellation event is durable and the workflow body was woken
-