public static void RunCheckCheck(Guid id, ReviewCheckCheck Form)
 {
     SqlWorkflowInstanceStore instanceStore = new SqlWorkflowInstanceStore(@"server=.\SQLEXPRESS;database=aspnetdb;uid=sa;pwd=123456");
     WorkflowApplication application2 = new WorkflowApplication(new DocumentPublish());
     application2.InstanceStore = instanceStore;
     application2.Completed = (workflowApplicationCompletedEventArgs) =>
     {
         Console.WriteLine("\nWorkflowApplication has Completed in the {0} state.", workflowApplicationCompletedEventArgs.CompletionState);
         instanceUnloaded.Set();
     };
     application2.PersistableIdle = (e) =>
     {
         instanceUnloaded.Set();
         return PersistableIdleAction.Unload;
     };
     application2.Unloaded = (workflowApplicationEventArgs) =>
     {
         Console.WriteLine("WorkflowApplication has Unloaded\n");
         instanceUnloaded.Set();
     };
     application2.Load(id);
     application2.ResumeBookmark("WaitCheckingChecking", Form);
     instanceUnloaded.WaitOne();
     Console.ReadLine();
 }
        public static void RunCheckCheck(Guid id, ReviewCheckCheck Form)
        {
            SqlWorkflowInstanceStore instanceStore = new SqlWorkflowInstanceStore(@"server=.\SQLEXPRESS;database=aspnetdb;uid=sa;pwd=123456");
            WorkflowApplication      application2  = new WorkflowApplication(new DocumentPublish());

            application2.InstanceStore = instanceStore;
            application2.Completed     = (workflowApplicationCompletedEventArgs) =>
            {
                Console.WriteLine("\nWorkflowApplication has Completed in the {0} state.", workflowApplicationCompletedEventArgs.CompletionState);
                instanceUnloaded.Set();
            };
            application2.PersistableIdle = (e) =>
            {
                instanceUnloaded.Set();
                return(PersistableIdleAction.Unload);
            };
            application2.Unloaded = (workflowApplicationEventArgs) =>
            {
                Console.WriteLine("WorkflowApplication has Unloaded\n");
                instanceUnloaded.Set();
            };
            application2.Load(id);
            application2.ResumeBookmark("WaitCheckingChecking", Form);
            instanceUnloaded.WaitOne();
            Console.ReadLine();
        }
示例#3
0
        // 如果活动返回值,则从 CodeActivity<TResult>
        // 派生并从 Execute 方法返回该值。
        protected override void Execute(CodeActivityContext context)
        {
            // 获取 Text 输入参数的运行时值
            ReviewCheckCheck ReviewCheckCheck = ReviewCheckChecks.Get(context);

            DocumentApply documentApply = inApply.Get(context);

            if (ReviewCheckCheck.Agree == 1)
            {
                documentApply.Status = 7;
            }
            else
            {
                documentApply.Status = 8;
            }
            new YunShanOA.BusinessLogic.DocumentManager.DocumentManager().Save(documentApply);

            outApply.Set(context, documentApply);
        }