WithdrawProcess() public method

撤销流程
public WithdrawProcess ( IDbConnection conn, Slickflow.Engine.Common.WfAppRunner withdrawer, IDbTransaction trans ) : WfExecutedResult
conn IDbConnection 连接
withdrawer Slickflow.Engine.Common.WfAppRunner 撤销人
trans IDbTransaction 事务
return Slickflow.Engine.Core.Result.WfExecutedResult
コード例 #1
0
        public ResponseResult WithdrawProcess(WfAppRunner runner)
        {
            IWorkflowService wfService = new WorkflowService();
            IDbConnection conn = SessionFactory.CreateConnection();

            IDbTransaction trans = null;
            try
            {
                trans = conn.BeginTransaction();
                var result = wfService.WithdrawProcess(conn, runner, trans);
                
                if (result.Status == WfExecutedStatus.Success)
                {
                    trans.Commit();
                    return ResponseResult.Success();
                }
                else
                {
                    trans.Rollback();
                    return ResponseResult.Error(result.Message);
                }
            }
            catch (WorkflowException w)
            {
                trans.Rollback();
                return ResponseResult.Error(w.Message);
            }
            finally
            {
                trans.Dispose();
                if (conn.State == ConnectionState.Open)
                    conn.Close();
            }
        }
コード例 #2
0
ファイル: FlowForm.cs プロジェクト: zengfanlin/Slickflow
        /// <summary>
        /// 撤销流程
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnWithdraw_Click(object sender, EventArgs e)
        {
            WfAppRunner appRunner = new WfAppRunner();
            appRunner.ProcessGUID = process_guid;
            appRunner.AppInstanceID = application_instance_id;
            appRunner.AppName = "WallwaOrder";
            appRunner.UserID = "1";
            appRunner.UserName = "******";

            IWorkflowService wfService = new WorkflowService();
            var result = wfService.WithdrawProcess(appRunner);
            var msg = string.Format("流程撤销结果:{0}\r\n", result.Status);
            textBox1.Text += msg;
        }