Add initial action to repository config

- Now RepositoryState can have initial action
  if it is an initial state.
- Implement all needed tests.
- Fixes #281
This commit is contained in:
Janne Valkealahti
2016-11-23 13:55:52 +00:00
parent ea511b8ed8
commit 0c3ea7fb2d
10 changed files with 188 additions and 1 deletions

View File

@@ -109,6 +109,23 @@ public class StateData<S, E> {
*/
public StateData(Object parent, Object region, S state, Collection<E> deferred,
Collection<? extends Action<S, E>> entryActions, Collection<? extends Action<S, E>> exitActions, boolean initial) {
this(parent, region, state, deferred, entryActions, exitActions, initial, null);
}
/**
* Instantiates a new state data.
*
* @param parent the parent
* @param region the region
* @param state the state
* @param deferred the deferred
* @param entryActions the entry actions
* @param exitActions the exit actions
* @param initial the initial
* @param initialAction the initial action
*/
public StateData(Object parent, Object region, S state, Collection<E> deferred,
Collection<? extends Action<S, E>> entryActions, Collection<? extends Action<S, E>> exitActions, boolean initial, Action<S, E> initialAction) {
this.state = state;
this.deferred = deferred;
this.entryActions = entryActions;
@@ -116,6 +133,7 @@ public class StateData<S, E> {
this.parent = parent;
this.region = region;
this.initial = initial;
this.initialAction = initialAction;
}
/**