public ReverseProcess ( IDbConnection conn, Slickflow.Engine.Common.WfAppRunner ender, IDbTransaction trans ) : |
||
conn | IDbConnection | 连接 |
ender | Slickflow.Engine.Common.WfAppRunner | 结束人 |
trans | IDbTransaction | 事务 |
return |
public ResponseResult ReverseProcess(WfAppRunner runner) { IWorkflowService wfService = new WorkflowService(); IDbConnection conn = new SqlConnection(DBConfig.ConnectionString); conn.Open(); IDbTransaction trans = null; try { trans = conn.BeginTransaction(); var result = wfService.ReverseProcess(conn, runner, trans); trans.Commit(); if (result.Status == WfExecutedStatus.Success) return ResponseResult.Success(); else 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(); } }