Skip to content

Commit e057081

Browse files
egreijusjvalkeal
authored andcommitted
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 - Backport #978 - Fixes #982
1 parent ec06395 commit e057081

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

spring-statemachine-core/src/main/java/org/springframework/statemachine/service/DefaultStateMachineService.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2019 the original author or authors.
2+
* Copyright 2017-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -165,8 +165,7 @@ protected StateMachine<S, E> restoreStateMachine(StateMachine<S, E> stateMachine
165165
return stateMachine;
166166
}
167167
stateMachine.stopReactively().block();
168-
// only go via top region
169-
stateMachine.getStateMachineAccessor().doWithRegion(function -> function.resetStateMachineReactively(stateMachineContext).block());
168+
stateMachine.getStateMachineAccessor().doWithAllRegions(function -> function.resetStateMachineReactively(stateMachineContext).block());
170169
return stateMachine;
171170
}
172171

0 commit comments

Comments
 (0)