I have a bunch of local activities with retry options configured that are being ran inside a cancellation scope like so:
val result = Workflow.newPromise<SomeClass>()
val scope = Workflow.newCancellationScope { _ ->
activity1.execute()
....
activityN.execute()
result.complete(someValue)
}
Workflow.newTimer(Duration.ofSeconds(10))
.thenApply {
scope.cancel()
result.complete(someOtherValue)
}
try {
scope.run()
result.get()
} catch (e: ActivityFailure) {
handleError()
}
I expected that when scope.cancel() method is called that would close the scope with the running activities just as it works with normal activities.
Instead, it proceeds to retry local activities. What can I do about it? Thanks in advance!