Esempio n. 1
0
        public static void Main(string[] args)
        {
            IServiceProvider serviceProvider = ConfigureServices();

            //start the workflow host
            var host = serviceProvider.GetService <IWorkflowHost>();

            host.RegisterWorkflow <EventSampleWorkflow, MyDataClass>();
            host.Start();

            var initialData = new MyDataClass();
            var workflowId  = host.StartWorkflow("EventSampleWorkflow", 1, initialData).Result;

            var temp = new MyDataClass()
            {
                StrValue1 = "something",
                StrValue2 = "somethingElse"
            };

            Console.WriteLine("Enter value to publish");
            string value = Console.ReadLine();

            //host.PublishEvent("MyEvent", workflowId, value);

            host.PublishEvent("MyEvent", workflowId, temp);

            Console.ReadLine();
            host.Stop();
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            IServiceProvider serviceProvider = ConfigureServices();

            //start the workflow host
            var host = serviceProvider.GetService <IWorkflowHost>();

            host.RegisterWorkflow <EventSampleWorkflow, MyDataClass>();
            host.Start();

            var initialData = new MyDataClass();

            host.StartWorkflow("EventSampleWorkflow", 1, initialData);

            Console.WriteLine("Enter value to publish");
            string value = Console.ReadLine();

            host.PublishEvent("MyEvent", "0", value);

            Console.ReadLine();
            host.Stop();
        }