protected virtual Transition BeginTransitionToState(OperationContext context, QualifiedName toState)
{
if (m_currentState == null || m_currentStateName == null)
{
GotoInitialState();
}
foreach (Transition transition in m_transitions)
{
if (transition.FromState == m_currentStateName && transition.ToState.BrowseName == toState)
{
return transition;
}
}
throw ServiceResultException.Create(
StatusCodes.BadMethodInvalid,
"Cannot move to {0} State while in the {1} State.",
toState.Name,
CurrentStateName);
}