private StateResult RunWorkflow(StateResult result) { while (result.ActionRequired == ActionRequiredEnum.TransitionToNewState) { var currentState = GetNewState(result.GetNextState()); result = currentState.DoAction(); } return(result); }