Interface WorkflowStepResult
- All Known Subinterfaces:
CombinatorWorkflowStepResult
- All Known Implementing Classes:
StateBasedWorkflowStepResult
public interface WorkflowStepResult
Represents a result of a step execution.
- Since:
- 5.4.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidawait()Blocks until step execution reaches a terminal state.voidcancel()Cancels this step if it is still running.voidCancels this step with a reason if it is still running.booleancanceled()Blocks until step execution reaches a terminal state.error()Retrieves an optional error.booleanfailure()Blocks until step execution reaches a terminal state.booleanCheck (non-blocking) if the step has finished (reached a terminal state).result()Retrieves optional result.default <T> Optional<T> Retrieves an optional result as a specific type.default <T> Optional<T> Retrieves an optional result as a specific type using a converter.<T> Optional<T> Retrieves an optional result as a specific type.<T> Optional<T> Retrieves an optional result as a specific type.default <T> Optional<T> resultAs(TypeReference<T> type) Retrieves an optional result as a specific type.default <T> Optional<T> resultAs(TypeReference<T> type, Converter converter) Retrieves an optional result as a specific type.booleansuccess()Blocks until step execution reaches a terminal state.booleantimeout()Blocks until step execution reaches a terminal state.
-
Method Details
-
getStepName
String getStepName() -
isCompleted
boolean isCompleted()Check (non-blocking) if the step has finished (reached a terminal state).- Returns:
- true, if the state is terminal.
-
result
Retrieves optional result.- Returns:
- result if the step has finished with a success. Will return empty optional, if the step is not finished.
-
resultAs
Retrieves an optional result as a specific type.- Type Parameters:
T- the type of the result- Parameters:
type- the type to convert the result to- Returns:
- result if the step has finished with a success. Will return empty optional, if the step is not finished
-
resultAs
Retrieves an optional result as a specific type.- Type Parameters:
T- the type of the result- Parameters:
type- the type to convert the result to- Returns:
- result if the step has finished with a success. Will return empty optional, if the step is not finished
-
resultAs
Retrieves an optional result as a specific type.- Type Parameters:
T- the type of the result- Parameters:
type- the type to convert the result to- Returns:
- result if the step has finished with a success. Will return empty optional, if the step is not finished
-
resultAs
Retrieves an optional result as a specific type using a converter.- Type Parameters:
T- the type of the result- Parameters:
type- the type to convert the result toconverter- the converter to use- Returns:
- result if the step has finished with a success. Will return empty optional, if the step is not finished
-
resultAs
Retrieves an optional result as a specific type.- Type Parameters:
T- the type of the result- Parameters:
type- the type to convert the result to- Returns:
- result if the step has finished with a success. Will return empty optional, if the step is not finished
-
resultAs
Retrieves an optional result as a specific type.- Parameters:
type- the type to convert the result to- Returns:
- result if the step has finished with a success. Will return empty optional, if the step is not finished
-
error
Optional<StepFailedException> error()Retrieves an optional error.- Returns:
- error if the step has finished with an error. Will return empty optional, if the step is not finished
-
success
boolean success()Blocks until step execution reaches a terminal state.- Returns:
- true, if the operation completed successfully
-
failure
boolean failure()Blocks until step execution reaches a terminal state.- Returns:
- true, if the operation completed with an exception
-
canceled
boolean canceled()Blocks until step execution reaches a terminal state.- Returns:
- true, if the operation was interrupted by an external party
-
timeout
boolean timeout()Blocks until step execution reaches a terminal state.- Returns:
- true, if the operation was interrupted by timeout specified on start
-
await
void await()Blocks until step execution reaches a terminal state. -
cancel
void cancel()Cancels this step if it is still running. No-op if already in a terminal state. -
cancel
Cancels this step with a reason if it is still running. No-op if already in a terminal state.- Parameters:
reason- human-readable cancellation reason.
-