Fix parent state ref

- For RepositoryState, its parent state is now
  defined as RepositoryState as well allowing
  to reference from a json files.
- Relates to #262
This commit is contained in:
Janne Valkealahti
2016-10-09 17:04:36 +01:00
parent c7951c5001
commit 3cc33a6fef
4 changed files with 14 additions and 9 deletions

View File

@@ -30,7 +30,7 @@ public abstract class RepositoryState extends BaseRepositoryEntity {
*
* @return the parent state
*/
public abstract String getParentState();
public abstract RepositoryState getParentState();
/**
* Gets the machine id.

View File

@@ -132,7 +132,9 @@ public class RepositoryStateMachineModelFactory extends AbstractStateMachineMode
}
}
StateData<String,String> stateData = new StateData<String, String>(s.getParentState(), null, s.getState(), s.isInitial());
RepositoryState parentState = s.getParentState();
StateData<String, String> stateData = new StateData<String, String>(parentState != null ? parentState.getState() : null, null,
s.getState(), s.isInitial());
stateData.setStateActions(stateActions);
stateData.setEntryActions(entryActions);
stateData.setExitActions(exitActions);