Open bhishambajaj1999 opened 1 year ago
You could collect the Mono
s into a list like this:
List<Mono<Void>> monos = new ArrayList<>();
stateMachine.getStateMachineAccessor()
.doWithAllRegions(access -> monos.add(access.resetStateMachineReactively(context)));
Mono.when(monos).thenEmpty(stateMachine.startReactively());
But I agree it's not that ideal...
The current doWithAllRegion method doesn't support non reactive api. void doWithAllRegions(Consumer<StateMachineAccess<S, E>> stateMachineAccess); I am using 3.0.1 version of spring state machine. To Restart the stateMachineReactively I have to use subscribe() which is not preferred. Please find the snippet
public Mono<StateMachine<OrderState, OrderEvent>> returnActivatedStateMachine( OrderState orderState, StateMachine<OrderState, OrderEvent> stateMachine) {
}
Can you please help with some reactive alternate for doWithAllRegions?