public static BaseState GetInstanceOf(WorkflowStates state, WorkflowManager manager) { switch (state) { case WorkflowStates.NewCustomer: return(new NewCustomerState(manager)); case WorkflowStates.LecturesSchedulePending: return(new LecturesSchedulePendingState(manager)); case WorkflowStates.LecturesScheduled: return(new LecturesScheduledState(manager)); case WorkflowStates.LecturesCompleted: return(new LecturesCompletedState(manager)); case WorkflowStates.KnowledgeTestScheduled: return(new KnowledgeTestScheduledState(manager)); case WorkflowStates.PracticalSchedulePending: return(new PracticalSchedulePendingState(manager)); case WorkflowStates.PracticalScheduled: return(new PracticalScheduledState(manager)); case WorkflowStates.PracticalScheduledB: return(new PracticalScheduledBState(manager)); case WorkflowStates.PracticalCompleted: return(new PracticalCompletedState(manager)); case WorkflowStates.ParkingTestScheduled: return(new ParkingTestScheduledState(manager)); case WorkflowStates.InternalAssessment: return(new InternalAssessmentState(manager)); case WorkflowStates.RoadTestScheduled: return(new RoadTestScheduledState(manager)); case WorkflowStates.LicenseIssuancePending: return(new LicenseIssuancePendingState(manager)); case WorkflowStates.LicenseIssued: return(new LicenseIssuedState(manager)); case WorkflowStates.AdditionalClassesPending: return(new AdditionalClassesPendingState(manager)); case WorkflowStates.AdditionalClassesScheduled: return(new AdditionalClassesScheduledState(manager)); case WorkflowStates.AdditionalClassesCompleted: return(new AdditionalClassesCompletedState(manager)); default: throw new Exception("Unknown Contract State!"); } }
public WorkflowManager(string identity, WorkflowIdentityType identityType) { this.DataAccess = new DAWorkflow(identity, identityType); // Set based on contract state in DB. WorkflowStates state = (WorkflowStates)this.DataAccess.GetCurrentState(); this.CurrentState = BaseState.GetInstanceOf(state, this); }
// Modified by AVANZA\muhammad.uzair on 01/11/2017 16:05:22 public WorkflowManager(int contractId) { this.ContractId = contractId; this.DataAccess = new DAWorkflow(this.ContractId); // Set based on contract state in DB. WorkflowStates state = (WorkflowStates)this.DataAccess.GetCurrentState(); this.CurrentState = BaseState.GetInstanceOf(state, this); }
public BaseState(WorkflowManager manager, WorkflowStates state) { this.Manager = manager; this.DataAccess = manager.DataAccess; this.InternalState = state; }
public Func <List <Engine.WorkflowStates.WorkflowState> > BuildWorkflowStates(Func <WorkflowStateConfig, Engine.WorkflowStates.WorkflowState> buildState) { return(() => WorkflowStates.BuildWorkflowStates(buildState)); }