Exemplo n.º 1
0
        public void OnUpdateStateRequest(UpdateStateRequest request)
        {
            var stateChange = request.ForRequestResponse.Result as IActionProcessingStateChange;

            _requirements.StatePersistence.SetCurrentState(request.ForRequest, stateChange.NewState);

            Sender.Tell(UpdateStateResponse.New(request, request.ForRequest));
        }
Exemplo n.º 2
0
        private bool UpdateState(IActionRequest request, IActionResponse response)
        {
            var stateChange = response.Result as IActionProcessingStateChange;
            var newState    = stateChange.NewState;

            if (!(request is null) &&
                request is IRequestWithState &&
                request.Context.ProcessingState != newState)
            {
                _stateManager.Tell(UpdateStateRequest.New(request, response));
                return(true);
            }