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 Type
    Method
    Description
    void
    Blocks until step execution reaches a terminal state.
    void
    Cancels this step if it is still running.
    void
    cancel(String reason)
    Cancels this step with a reason if it is still running.
    boolean
    Blocks until step execution reaches a terminal state.
    Retrieves an optional error.
    boolean
    Blocks until step execution reaches a terminal state.
     
    boolean
    Check (non-blocking) if the step has finished (reached a terminal state).
    Retrieves optional result.
    default <T> Optional<T>
    resultAs(Class<T> type)
    Retrieves an optional result as a specific type.
    default <T> Optional<T>
    resultAs(Class<T> type, Converter converter)
    Retrieves an optional result as a specific type using a converter.
    <T> Optional<T>
    resultAs(Type type)
    Retrieves an optional result as a specific type.
    <T> Optional<T>
    resultAs(Type type, Converter converter)
    Retrieves an optional result as a specific type.
    default <T> Optional<T>
    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.
    boolean
    Blocks until step execution reaches a terminal state.
    boolean
    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

      Optional<Map<String,@Nullable Object>> 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

      default <T> Optional<T> resultAs(Class<T> type)
      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

      default <T> Optional<T> resultAs(TypeReference<T> type)
      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

      <T> Optional<T> resultAs(Type type)
      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

      default <T> Optional<T> resultAs(Class<T> type, Converter converter)
      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 to
      converter - 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

      default <T> Optional<T> resultAs(TypeReference<T> type, Converter converter)
      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

      <T> Optional<T> resultAs(Type type, Converter converter)
      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

      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

      void cancel(String reason)
      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.