Package io.temporal.workflow
Class Saga.Options.Builder
- java.lang.Object
-
- io.temporal.workflow.Saga.Options.Builder
-
- Enclosing class:
- Saga.Options
public static final class Saga.Options.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Saga.Options
build()
Saga.Options.Builder
setContinueWithError(boolean continueWithError)
continueWithError gives user the option to bail out of compensation operations if exception is thrown while running them.Saga.Options.Builder
setParallelCompensation(boolean parallelCompensation)
This decides if the compensation operations are run in parallel.
-
-
-
Method Detail
-
setParallelCompensation
public Saga.Options.Builder setParallelCompensation(boolean parallelCompensation)
This decides if the compensation operations are run in parallel. If parallelCompensation is false, then the compensation operations will be run the reverse order as they are added.- Parameters:
parallelCompensation
- default is false.
-
setContinueWithError
public Saga.Options.Builder setContinueWithError(boolean continueWithError)
continueWithError gives user the option to bail out of compensation operations if exception is thrown while running them. This is useful only when parallelCompensation is false. If parallel compensation is set to true, then all the compensation operations will be fired no matter what and caller will receive exceptions back if there's any.- Parameters:
continueWithError
- whether to proceed with the next compensation operation if the previous throws exception. This only applies to sequential compensation. Default is false.- Returns:
- option builder
-
build
public Saga.Options build()
-
-