Package io.dapr.workflows.saga
Class DaprSagaContextImpl
java.lang.Object
io.dapr.workflows.saga.DaprSagaContextImpl
- All Implemented Interfaces:
SagaContext
Dapr Saga Context implementation.
-
Constructor Summary
ConstructorDescriptionDaprSagaContextImpl
(Saga saga, WorkflowContext workflowContext) Constructor to build up instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Compensate all registered activities.void
registerCompensation
(String activityClassName, Object activityInput) Register a compensation activity.
-
Constructor Details
-
DaprSagaContextImpl
Constructor to build up instance.- Parameters:
saga
- Saga instance.workflowContext
- Workflow context.- Throws:
IllegalArgumentException
- if saga or workflowContext is null.
-
-
Method Details
-
registerCompensation
Description copied from interface:SagaContext
Register a compensation activity.- Specified by:
registerCompensation
in interfaceSagaContext
- Parameters:
activityClassName
- name of the activity classactivityInput
- input of the activity to be compensated
-
compensate
public void compensate()Description copied from interface:SagaContext
Compensate all registered activities.- Specified by:
compensate
in interfaceSagaContext
-