Class StepMovement<I>

java.lang.Object
io.superdurable.dex.StepMovement<I>
Type Parameters:
I - the target Step's input type

public final class StepMovement<I> extends Object
Describes one transition to a typed Step and its input.

Use movements when a decision or RPC starts one or more next Steps. Options supplied to a movement override the target Step's default options for that execution only.

return StepDecision.goToMany(
        StepMovement.of(ReserveInventory.class, order),
        StepMovement.of(AuthorizePayment.class, order, paymentOptions));
  • Method Details

    • of

      public static <I> StepMovement<I> of(Class<? extends Step<I>> stepClass, I input)
      Creates a movement using the target Step's default options.
      Type Parameters:
      I - the target Step's input type
      Parameters:
      stepClass - the target Step class
      input - the typed input for that Step
      Returns:
      the typed Step movement
    • of

      public static <I> StepMovement<I> of(Class<? extends Step<I>> stepClass, I input, StepOptions options)
      Creates a movement with per-execution Step options.
      Type Parameters:
      I - the target Step's input type
      Parameters:
      stepClass - the target Step class
      input - the typed input for that Step
      options - the per-execution options, or null to use Step defaults
      Returns:
      the typed Step movement