From 4da9c52742faa51b0085ea3b04abbe0a32949960 Mon Sep 17 00:00:00 2001 From: Erik Greijus Date: Sat, 26 Jun 2021 17:25:28 +0200 Subject: [PATCH] Restore all regions of statemachine - Restore all regions of statemachine - A persisted statemachine with orthogonal states will not be correctly restored as only the top region gets correctly reset. Tests in StateMachineResetTests use the correct way to reset the statemachine with all regions - Fixes #978 --- .../statemachine/service/DefaultStateMachineService.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-statemachine-core/src/main/java/org/springframework/statemachine/service/DefaultStateMachineService.java b/spring-statemachine-core/src/main/java/org/springframework/statemachine/service/DefaultStateMachineService.java index 0185cc17..8b97337f 100644 --- a/spring-statemachine-core/src/main/java/org/springframework/statemachine/service/DefaultStateMachineService.java +++ b/spring-statemachine-core/src/main/java/org/springframework/statemachine/service/DefaultStateMachineService.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2019 the original author or authors. + * Copyright 2017-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -165,8 +165,7 @@ public class DefaultStateMachineService implements StateMachineService function.resetStateMachineReactively(stateMachineContext).block()); + stateMachine.getStateMachineAccessor().doWithAllRegions(function -> function.resetStateMachineReactively(stateMachineContext).block()); return stateMachine; }