Class Saga

java.lang.Object
io.dapr.workflows.saga.Saga

public final class Saga extends Object
  • Constructor Details

    • Saga

      public Saga(SagaOption option)
      Build up a Saga with its options.
      Parameters:
      option - Saga option.
  • Method Details

    • registerCompensation

      public void registerCompensation(String activityClassName, Object activityInput)
      Register a compensation activity.
      Parameters:
      activityClassName - name of the activity class
      activityInput - input of the activity to be compensated
    • registerCompensation

      public void registerCompensation(String activityClassName, Object activityInput, com.microsoft.durabletask.TaskOptions taskOptions)
      Register a compensation activity.
      Parameters:
      activityClassName - name of the activity class
      activityInput - input of the activity to be compensated
      taskOptions - task options to set retry strategy
    • compensate

      public void compensate(WorkflowContext ctx)
      Compensate all registered activities.
      Parameters:
      ctx - Workflow context.