Пример #1
0
        private void bar_btn_Crate_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var FlowID = new DAL.FlowService().CreateFlow(new Flow()
            {
                F_Title = "新的工作流", F_U_ID = 1, F_State = false, F_FlowInstanceID = default(Guid).ToString(), F_CurrentInfo = "流程已创建", F_CreateTime = DateTime.Now
            });

            WorkFlowCommon.CreateWorkFlow <BaseActivity, Frm_Test>(new Dictionary <string, object> {
                { "FlowID", FlowID }, { "BookMarks", new int[] { 1, 2 } }
            }, WorkFlowCommon.InstanceStore);
        }
Пример #2
0
 private void Frm_BaseFlow_LoadAsync(object sender, EventArgs e)
 {
     if (!DesignMode)
     {
         Instance.Run();
         foreach (Control ctl in Controls)
         {
             if (ctl is Button && ctl.Name.IndexOf("Resume") > 0)
             {
                 ctl.Click += (object s, EventArgs ear) =>
                 {
                     if (txt_Guid.Text != "")
                     {
                         Instance = new WorkflowApplication((Activity)Activator.CreateInstance(ActivityType));
                         Instance.InstanceStore = WorkFlowCommon.InstanceStore;
                         var RecoverState = WorkFlowCommon.AwakenWorkFlow(ActivityType, Guid.Parse(txt_Guid.Text), txt_BookName.Text, txt_Value.Text, this);
                         if (RecoverState == RecoveryFlowState.NoSaveInstance)
                         {
                         }
                     }
                     else
                     {
                         if (InstanceID != default)
                         {
                             Instance = new WorkflowApplication((Activity)Activator.CreateInstance(ActivityType));
                             Instance.InstanceStore = WorkFlowCommon.InstanceStore;
                             WorkFlowCommon.AwakenWorkFlow(ActivityType, InstanceID, txt_BookName.Text, txt_Value.Text, this);
                         }
                     }
                     if (Instance.GetBookmarks().Count(b => b.BookmarkName == txt_BookName.Text) == 1)
                     {
                         Instance.ResumeBookmark(txt_BookName.Text, txt_Value.Text);
                     }
                 };
             }
         }
     }
 }