Exemple #1
0
        static void Main()
        {
            using (WorkflowRuntime workflowRuntime = new WorkflowRuntime())
            {
                // Create our local service and add it to the workflow runtime's list of services
                ExternalDataExchangeService dataService = new ExternalDataExchangeService();
                workflowRuntime.AddService(dataService);
                VotingServiceImpl votingService = new VotingServiceImpl();
                dataService.AddService(votingService);

                // Start up the runtime and hook the creation and completion events
                workflowRuntime.StartRuntime();

                workflowRuntime.WorkflowCompleted  += OnWorkflowCompleted;
                workflowRuntime.WorkflowTerminated += OnWorkflowTerminated;
                workflowRuntime.WorkflowStarted    += OnWorkflowStarted;

                // Create the workflow's parameters collection
                Dictionary <string, object> parameters = new Dictionary <string, object>();
                parameters.Add("Alias", "Jim");
                // Create and start the workflow
                Type type = typeof(HostCommunication.VotingServiceWorkflow);
                workflowRuntime.CreateWorkflow(type, parameters).Start();

                waitHandle.WaitOne();

                // Cleanly stop the runtime and all services
                workflowRuntime.StopRuntime();
            }
        }
Exemple #2
0
        static void Main()
        {
            using (WorkflowRuntime workflowRuntime = new WorkflowRuntime())
            {

                // Create our local service and add it to the workflow runtime's list of services
                ExternalDataExchangeService dataService = new ExternalDataExchangeService();
                workflowRuntime.AddService(dataService);
                VotingServiceImpl votingService = new VotingServiceImpl();
                dataService.AddService(votingService);

                // Start up the runtime and hook the creation and completion events
                workflowRuntime.StartRuntime();

                workflowRuntime.WorkflowCompleted += OnWorkflowCompleted;
                workflowRuntime.WorkflowTerminated += OnWorkflowTerminated;
                workflowRuntime.WorkflowStarted += OnWorkflowStarted;

                // Create the workflow's parameters collection
                Dictionary<string, object> parameters = new Dictionary<string, object>();
                parameters.Add("Alias", "Jim");
                // Create and start the workflow
                Type type = typeof(HostCommunication.VotingServiceWorkflow);
                workflowRuntime.CreateWorkflow(type, parameters).Start();

                waitHandle.WaitOne();

                // Cleanly stop the runtime and all services
                workflowRuntime.StopRuntime();
            }
        }