static void Main(string[] args) { IBus bus = new AzureBus(); IMovieBookingService movieBookingService = new MovieBookingService(bus); ICommonWorkflowService commonWorkflowService = new CommonWorkflowService(bus); IStateMachineMapper stateMachineMapper = new StateMachineMapper(bus, commonWorkflowService); WorkflowInstanceRepository instanceRepository = new WorkflowInstanceRepository(); SmsHandler smsHandler = new SmsHandler(stateMachineMapper, bus, instanceRepository); ForkHandler forkHandler = new ForkHandler(instanceRepository, stateMachineMapper); DisambiguateMovieBookingHandler disambiguateHandler = new DisambiguateMovieBookingHandler(instanceRepository, stateMachineMapper); bus.Subscribe<SmsReceived>("workflow-service", smsHandler.Handle); bus.Subscribe<ForkFinished>("workflow-service", forkHandler.Handle); bus.Subscribe<StartDisambiguateMovieBooking>("workflow-service", disambiguateHandler.Handle); bus.Subscribe<DisambiguateMovieBookingFinished>("workflow-service", disambiguateHandler.Handle); Console.ReadKey(); }
static void Main(string[] args) { IBus bus = new AzureBus(); IMovieBookingService movieBookingService = new MovieBookingService(bus); ICommonWorkflowService commonWorkflowService = new CommonWorkflowService(bus); IStateMachineMapper stateMachineMapper = new StateMachineMapper(bus, commonWorkflowService); WorkflowInstanceRepository instanceRepository = new WorkflowInstanceRepository(); SmsHandler smsHandler = new SmsHandler(stateMachineMapper, bus, instanceRepository); ForkHandler forkHandler = new ForkHandler(instanceRepository, stateMachineMapper); DisambiguateMovieBookingHandler disambiguateHandler = new DisambiguateMovieBookingHandler(instanceRepository, stateMachineMapper); bus.Subscribe <SmsReceived>("workflow-service", smsHandler.Handle); bus.Subscribe <ForkFinished>("workflow-service", forkHandler.Handle); bus.Subscribe <StartDisambiguateMovieBooking>("workflow-service", disambiguateHandler.Handle); bus.Subscribe <DisambiguateMovieBookingFinished>("workflow-service", disambiguateHandler.Handle); Console.ReadKey(); }