private void ProcessOutcome(StationOutcome outcome) { // TODO: Decouple this method from the form // Use a state pattern // If the item is on hold, but allows station data // then update the outcome, but no do not perform routing. if (m_item.Hold != null && m_item.Hold.AllowStationData) { m_process.StationOutcome = outcome; return; } if (!IsTransitionValid()) { outcomeSelList.EditValue = null; return; } StationOutcomeTransition transition = GetTransition(outcome.Label); if (transition.EndProcessRoute) { SetupEndProcess(outcome); } else { SetupNextStation(outcome); } }
public bool ProcessStation(RouteStationProcess process) { RemoveBlankStepResults(process); if (!new RouteStationProcessValidator(process).Validated()) { return(false); } if (process.StationOutcome == null) { return(true); } // Get the station outcome transition if it exists. StationOutcomeTransition transition = process.Station.GetOutcomeTransitionFor(process.StationOutcome); if ( !new StationOutcomeTransitionValidator(transition, process). Validated()) { return(false); } // Move the unit to the next station if defined. if (process.NextStation != null) { MoveUnitToNextStation(process); } // End the process if a transition was determined and the transition is defined // as the end of a process else if (transition != null && transition.EndProcessRoute) { EndProcess(process); } ProcessStationConditions(process); return(true); }
public StationOutcomeTransitionValidator(StationOutcomeTransition transition, RouteStationProcess process) { m_transition = transition; m_process = process; }