Interface Workflow.Effect.Builder<S>

Type Parameters:
S - The type of the state for this workflow.
Enclosing interface:
Workflow.Effect<T>

public static interface Workflow.Effect.Builder<S>
Construct the effect that is returned by the command handler or a step transition.

The effect describes next processing actions, such as updating state, transition to another step and sending a reply.

  • Method Details

    • updateState

    • pause

      Pause the workflow execution and wait for an external input, e.g. via command handler.
    • pause

      Pause the workflow execution with a reason description and wait for an external input, e.g. via command handler.
    • pause

      Pause the workflow execution with advanced configuration options.

      This method allows pausing the workflow with a timeout and a handler that will be invoked when the timeout expires. The pause can also include an optional reason description.

      Use the Workflow.pauseSetting(Duration) method to start building the Workflow.PauseSettings.

      Parameters:
      pauseSettings - Configuration for the pause including timeout duration and handler
    • transitionTo

      <W> Workflow.Effect.Transitional transitionTo(akka.japi.function.Function<W,Workflow.StepEffect> methodRef)
      Defines the next step to which the workflow should transition to.

      The step is identified by a method reference that accepts no input parameters.

      Type Parameters:
      W - The workflow type containing the step method
      Parameters:
      methodRef - Reference to the step method
      Returns:
      A transitional effect
    • transitionTo

      <W, I> Workflow.WithInput<I,Workflow.Effect.Transitional> transitionTo(akka.japi.function.Function2<W,I,Workflow.StepEffect> methodRef)
      Defines the next step to which the workflow should transition to.

      The step is identified by a method reference that accepts an input parameter.

      Type Parameters:
      W - The workflow type containing the step method
      I - The input parameter type for the step
      Parameters:
      methodRef - Reference to the step method
      Returns:
      A builder to provide the input parameter
    • end

      Finish the workflow execution. After transition to end, no more transitions are allowed.
    • end

      Finish the workflow execution with a reason description. After transition to end, no more transitions are allowed.
    • delete

      Finish and delete the workflow execution. After transition to delete, no more transitions are allowed. The actual workflow state deletion is done with a configurable delay to allow downstream consumers to observe that fact.
    • delete

      Finish and delete the workflow execution with a reason description. After transition to delete, no more transitions are allowed. The actual workflow state deletion is done with a configurable delay to allow downstream consumers to observe that fact.
    • reply

      <R> Workflow.ReadOnlyEffect<R> reply(R replyMessage)
      Create a message reply.
      Type Parameters:
      R - The type of the message that must be returned by this call.
      Parameters:
      replyMessage - The payload of the reply.
      Returns:
      A message reply.
    • reply

      <R> Workflow.ReadOnlyEffect<R> reply(R message, Metadata metadata)
      Reply after for example updateState.
      Type Parameters:
      R - The type of the message that must be returned by this call.
      Parameters:
      message - The payload of the reply.
      metadata - The metadata for the message.
      Returns:
      A message reply.
    • error

      <R> Workflow.ReadOnlyEffect<R> error(String message)
      Create an error reply.
      Type Parameters:
      R - The type of the message that must be returned by this call.
      Parameters:
      message - The error message.
      Returns:
      An error reply.
    • error

      <R> Workflow.ReadOnlyEffect<R> error(CommandException commandException)
      Create an error reply. CommandException will be serialized and sent to the client. It's possible to catch it with try-catch statement or CompletionStage API when using async ComponentClient API.
      Type Parameters:
      R - The type of the message that must be returned by this call.
      Parameters:
      commandException - The command exception to be returned.
      Returns:
      An error reply.