Esempio n. 1
0
        public void SimpleExecution()
        {
            var runtime = new WorkflowRuntime();
            var handle  = runtime.RunProgram(SampleProgram.Create());

            // Simulate input reception
            string input        = "400";
            string bookmarkName = "ReadLine";

            handle.Resume(bookmarkName, input);

            // Finished without problems
        }
Esempio n. 2
0
        public void SuspendedExecution()
        {
            var runtime = new WorkflowRuntime();

            var handle = runtime.RunProgram(SampleProgram.Create());

            Guid programId = handle.ProgramId;

            // Save the workflow
            handle.Passivate();

            // Force GC
            handle = null;
            GC.Collect();

            // Simulate input reception
            string input        = "400";
            string bookmarkName = "ReadLine";

            // Get back the handle we "lost"
            handle = runtime.GetProgramHandle(programId);
            handle.Resume(bookmarkName, input);
        }