Fix internal transition for dist machine
- Change previous DistributedStateMachine fixes which didn't really work. Now explicitely getting state from machine to be set into ensemble for post internal transition. - Now can send Message<E> via test plan instead of plain E. - More testing for tweaked features.
This commit is contained in:
@@ -219,11 +219,14 @@ public class DistributedStateMachine<S, E> extends LifecycleObjectSupport implem
|
||||
stateContext.getMessageHeader(StateMachineSystemConstants.STATEMACHINE_IDENTIFIER))) {
|
||||
StateMachineContext<S, E> current = ensemble.getState();
|
||||
if (current != null) {
|
||||
// TODO: it feels a bit wrong that this can be null so
|
||||
// adding note here. feel this will come back to haunt us
|
||||
ensemble.setState(new DefaultStateMachineContext<S, E>(
|
||||
current.getState(), stateContext.getEvent(), stateContext
|
||||
.getMessageHeaders(), stateContext.getStateMachine().getExtendedState()));
|
||||
} else if (stateContext.getStateMachine().getState() != null) {
|
||||
// if current ensemble state is null, get it from sm itself
|
||||
ensemble.setState(new DefaultStateMachineContext<S, E>(stateContext.getStateMachine().getState()
|
||||
.getId(), stateContext.getEvent(), stateContext.getMessageHeaders(), stateContext
|
||||
.getStateMachine().getExtendedState()));
|
||||
}
|
||||
}
|
||||
return stateContext;
|
||||
|
||||
Reference in New Issue
Block a user