public static void RunReviewQicao(Guid id, ReviewQicao 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("WaitReviewQicao", Form);
            instanceUnloaded.WaitOne();
            Console.ReadLine();
        }
Exemple #2
0
        // 如果活动返回值,则从 CodeActivity<TResult>
        // 派生并从 Execute 方法返回该值。
        protected override void Execute(CodeActivityContext context)
        {
            // 获取 Text 输入参数的运行时值
            ReviewQicao   reviewQicao   = Reviewqicao.Get(context);
            DocumentApply documentApply = inApply.Get(context);

            if (reviewQicao.Agree == 1)
            {
                documentApply.Status = 2;
            }
            else
            {
                documentApply.Status = 3;
            }
            new YunShanOA.BusinessLogic.DocumentManager.DocumentManager().Save(documentApply);
            outApply.Set(context, documentApply);
        }
 public static void RunReviewQicao(Guid id, ReviewQicao 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("WaitReviewQicao", Form);
     instanceUnloaded.WaitOne();
     Console.ReadLine();
 }