Class Saga.Options.Builder
java.lang.Object
io.temporal.workflow.Saga.Options.Builder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()setContinueWithError(boolean continueWithError) continueWithError gives user the option to bail out of compensation operations if exception is thrown while running them.setParallelCompensation(boolean parallelCompensation) This decides if the compensation operations are run in parallel.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setParallelCompensation
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
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
-