Class FlowResult
java.lang.Object
io.superdurable.dex.FlowResult
Describes the observed state and output of a Flow used as a SubFlow or waited on by a client.
A result returned by Client.waitForFlow(String) is always terminal. A result obtained
from SubFlow.getConditionResults(Context) may have FlowStatus.RUNNING when a
surrounding Wait.anyOf(Condition...) completed first. That running status is a durable
snapshot, not a live backend query. Use SubFlow.getFlowId(Context) when an application
needs to inspect or stop that SubFlow.
-
Method Summary
Modifier and TypeMethodDescriptionReturns every output-bearing Step completion in server collection order.Returns the server-provided failure detail.Returns the Dex Flow failure category.<T> TgetSingleOutput(Class<T> outputType) Decodes the output when exactly one Step completion exists.Returns the observed Flow status.booleanReturns whether this result represents a terminal Flow execution.
-
Method Details
-
getStatus
Returns the observed Flow status.For a SubFlow result,
FlowStatus.RUNNINGdescribes the durable snapshot created when the parent Wait completed. It does not guarantee that the SubFlow is still running when this method is called.- Returns:
- the non-null observed status
-
isTerminal
public boolean isTerminal()Returns whether this result represents a terminal Flow execution.- Returns:
falsefor running or continued-as-new states; otherwisetrue
-
getErrorType
Returns the Dex Flow failure category.- Returns:
- the category, or
nullwhen the Flow did not expose a Dex application error
-
getErrorMessage
Returns the server-provided failure detail.- Returns:
- the failure detail, or
nullwhen no detail is available
-
getCompletions
Returns every output-bearing Step completion in server collection order.The returned list is immutable. Parallel completion order is not a business ordering contract. A running SubFlow snapshot always returns an empty list.
- Returns:
- an immutable, non-null completion list
-
getSingleOutput
Decodes the output when exactly one Step completion exists.- Type Parameters:
T- the expected output type- Parameters:
outputType- the concrete Java output class- Returns:
- the only decoded Step output
- Throws:
IllegalStateException- if the result is running or has other than one outputValueMappingException- if decoding fails
-