在练习WF的Hands-on Labs\Lab03部分的时候,遇到了一个如下的问题:

代码比较简单:

  • static string connectionString = "Initial Catalog=TrackingStore; " +
  •                    "Data Source=.; " +
  •                              "Integrated Security=SSPI;";
  •         static void Main(string[] args)
  •         {
  •             using(WorkflowRuntime workflowRuntime = new WorkflowRuntime())
  •             {
  •                 workflowRuntime.AddService(new SqlTrackingService(connectionString));
  •                 AutoResetEvent waitHandle = new AutoResetEvent(false);
  •                 workflowRuntime.WorkflowCompleted += delegate(object sender,
  •                              WorkflowCompletedEventArgs e) { waitHandle.Set(); };
  •                 workflowRuntime.WorkflowTerminated += delegate(object sender,
  •                                 WorkflowTerminatedEventArgs e)
  •                 {
  •                     Console.WriteLine(e.Exception.Message);
  •                     waitHandle.Set();
  •                 };
  •                 WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof
  •                    (DefaultSQLServices.Workflow1));
  •                 instance.Start();
  •                 instance.Suspend("Reason we are suspending the workflow.");
  •                 instance.Resume();
  •                 waitHandle.WaitOne();
  •                 GetInstanceTrackingEvents(instance.InstanceId);
  •                 Console.WriteLine("Workflow Completed - press ENTER to continue");
  •                 Console.Read();
  •             }            
  •         }
  • 相关文章:

    • 2021-06-10
    • 2021-08-03
    • 2022-02-25
    • 2021-06-10
    • 2022-12-23
    • 2021-07-26
    • 2021-07-16
    猜你喜欢
    • 2021-06-10
    • 2021-05-27
    • 2021-04-05
    • 2021-05-24
    • 2022-12-23
    相关资源
    相似解决方案