예제 #1
0
        public TxProcessExecutor ExecuteRollback(Action <TxProcess> action)
        {
            using (TransactionScope scope = TransactionScopeFactory.Create())
            {
                if (action != null)
                {
                    action(this._Process);
                }

                TxProcess process = this._Process;

                string connectionName = this.GetConnectionName();

                process.RollbackToPreviousActivity();
                TxProcessAdapter.GetInstance(connectionName).Update(process);

                //发送流转流程的任务
                InvokeServiceTaskAdapter.Instance.Push(process.ToSyncAndRollbackActivityTask());

                //发送流转操作
                scope.Complete();
            }

            return(this);
        }
예제 #2
0
        public TxProcess CopyTo(TxProcess process, string targetConnectionName)
        {
            process.NullCheck("process");

            TxProcessAdapter.GetInstance(targetConnectionName).Update(process);

            return(process);
        }
예제 #3
0
        public static TxProcessAdapter GetInstance(string connectionName)
        {
            TxProcessAdapter result = DefaultInstance;

            if (connectionName.IsNotEmpty())
            {
                result = new TxProcessAdapter(connectionName);
            }

            return(result);
        }