Class DaprSagaContextImpl

java.lang.Object
io.dapr.workflows.saga.DaprSagaContextImpl
All Implemented Interfaces:
SagaContext

public class DaprSagaContextImpl extends Object implements SagaContext
Dapr Saga Context implementation.
  • Constructor Details

    • DaprSagaContextImpl

      public DaprSagaContextImpl(Saga saga, WorkflowContext workflowContext)
      Constructor to build up instance.
      Parameters:
      saga - Saga instance.
      workflowContext - Workflow context.
      Throws:
      IllegalArgumentException - if saga or workflowContext is null.
  • Method Details

    • registerCompensation

      public void registerCompensation(String activityClassName, Object activityInput)
      Description copied from interface: SagaContext
      Register a compensation activity.
      Specified by:
      registerCompensation in interface SagaContext
      Parameters:
      activityClassName - name of the activity class
      activityInput - input of the activity to be compensated
    • compensate

      public void compensate()
      Description copied from interface: SagaContext
      Compensate all registered activities.
      Specified by:
      compensate in interface SagaContext