I want a loop that after each iteration waits for a while. I'm trying to use a timer to do the waiting, but the timer never returns, so the below code only runs once and then waits forever. When I remove the timer condition, the code executes successfully. There are no errors, it just waits...
Any help is appreciated!
@override
public void doWorkflow() {
validate("test", 1);
}
@Asynchronous
private void validate(String id, int retries, Promise<?>... waitFor) {
Promise<Boolean> isValid = activityClient.validate(id);
doWork(id, retries, isValid);
}
@Asynchronous
private void doWork(String id, int retries, Promise<Boolean> isValid) {
if (!isValid.get()) {
return;
}
Promise<Void> waitFor = decisionContext.getWorkflowClock().createTimer(5);
validate(id, retries - 1, waitFor);
}