}
if (message.getBatchMessageMode() == false) {
// create currentStateDelta for this partition
String initState = _stateModelDefs.get(message.getStateModelDef()).getInitialState();
StateModel stateModel = stateModelFactory.getStateModel(partitionKey);
if (stateModel == null) {
stateModel = stateModelFactory.createAndAddStateModel(partitionKey);
stateModel.updateState(initState);
}
// TODO: move currentStateDelta to StateTransitionMsgHandler
CurrentState currentStateDelta = new CurrentState(resourceName);
currentStateDelta.setSessionId(sessionId);
currentStateDelta.setStateModelDefRef(stateModelName);
currentStateDelta.setStateModelFactoryName(factoryName);
currentStateDelta.setBucketSize(bucketSize);
currentStateDelta.setState(partitionKey, (stateModel.getCurrentState() == null) ? initState
: stateModel.getCurrentState());
return new HelixStateTransitionHandler(stateModelFactory, stateModel, message, context,
currentStateDelta);
} else {
BatchMessageWrapper wrapper = stateModelFactory.getBatchMessageWrapper(resourceName);