Add repository config substates
- Add parent state to RepositoryState and use it in model factory. - Relates to #262
This commit is contained in:
@@ -23,6 +23,13 @@ package org.springframework.statemachine.data;
|
||||
*/
|
||||
public interface RepositoryState {
|
||||
|
||||
/**
|
||||
* Gets the parent state.
|
||||
*
|
||||
* @return the parent state
|
||||
*/
|
||||
String getParentState();
|
||||
|
||||
/**
|
||||
* Gets the machine id.
|
||||
*
|
||||
|
||||
@@ -62,7 +62,7 @@ public class RepositoryStateMachineModelFactory implements StateMachineModelFact
|
||||
|
||||
Collection<StateData<String, String>> stateData = new ArrayList<>();
|
||||
for (RepositoryState s : stateRepository.findByMachineId(machineId)) {
|
||||
stateData.add(new StateData<String, String>(s.getState(), s.isInitial()));
|
||||
stateData.add(new StateData<String, String>(s.getParentState(), null, s.getState(), s.isInitial()));
|
||||
}
|
||||
StatesData<String, String> statesData = new StatesData<>(stateData);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user