コード例 #1
0
 protected virtual void OnAfterExecute(WfDesignerExecutorDataContext dataContext)
 {
     if (this.AfterExecute != null)
     {
         this.AfterExecute(dataContext);
     }
 }
コード例 #2
0
        private void InternalExecute()
        {
            WfDesignerExecutorDataContext dataContext = new WfDesignerExecutorDataContext(this, this.OperationType);

            try
            {
                ExecutionWrapper("BeforeExecute", () => this.OnBeforeExecute(dataContext));
                ExecutionWrapper("PrepareLogs", () => OnPrepareUserOperationLog(dataContext, dataContext.OperationLogs));

                using (TransactionScope scope = TransactionScopeFactory.Create())
                {
                    ExecutionWrapper("Execute", () => this.OnExecute(dataContext));
                    ExecutionWrapper("SaveOperationLogs", () => this.OnSaveUserOperationLogs(dataContext, dataContext.OperationLogs));

                    scope.Complete();
                }
            }
            catch (System.Exception ex)
            {
                bool autoThrow = true;

                this.OnError(ex, dataContext, ref autoThrow);

                if (autoThrow)
                {
                    throw;
                }
            }
            finally
            {
                ExecutionWrapper("AfterExecute", () => this.OnAfterExecute(dataContext));
            }
        }
コード例 #3
0
 protected virtual void OnError(System.Exception ex, WfDesignerExecutorDataContext dataContext, ref bool autoThrow)
 {
     if (this.Error != null)
     {
         this.Error(ex, dataContext, ref autoThrow);
     }
 }
コード例 #4
0
 protected virtual void FirePrepareUserOperationLog(WfDesignerExecutorDataContext dataContext, UserOperationLogCollection logs)
 {
     if (this.PrepareUserOperationLog != null)
     {
         this.PrepareUserOperationLog(dataContext, logs);
     }
 }
コード例 #5
0
        protected override void OnSaveUserOperationLogs(WfDesignerExecutorDataContext dataContext, UserOperationLogCollection logs)
        {
            List <IWfProcessDescriptor> importedProcesses = dataContext.GetValue("ImportedProcesses", new List <IWfProcessDescriptor>());

            importedProcesses.ForEach(processDesp => logs.Add(this.CreateImportLog(processDesp)));

            this.FillEnvironmentInfoToLogs(logs);
            base.OnSaveUserOperationLogs(dataContext, logs);
        }
コード例 #6
0
        protected override void OnExecute(WfDesignerExecutorDataContext dataContext)
        {
            using (TransactionScope scope = TransactionScopeFactory.Create())
            {
                SOARolePropertyDefinitionAdapter.Instance.Delete(this.MatrixID);
                SOARolePropertiesAdapter.Instance.Delete(this.MatrixID);

                scope.Complete();
            }
        }
コード例 #7
0
        protected override void OnPrepareUserOperationLog(WfDesignerExecutorDataContext dataContext, UserOperationLogCollection logs)
        {
            UserOperationLog log = new UserOperationLog();

            log.Subject = string.Format("{0}", this.OperationType.ToDescription());

            logs.Add(log);

            base.OnPrepareUserOperationLog(dataContext, logs);

            this.FillEnvironmentInfoToLogs(logs);
        }
コード例 #8
0
        protected override void OnExecute(WfDesignerExecutorDataContext dataContext)
        {
            this._InputStream.Seek(0, SeekOrigin.Begin);

            WorkBook workBook = WorkBook.Load(this._InputStream);

            WfApprovalMatrix matrix = workBook.ToApprovalMatrix();

            matrix.ID = this.MatrixID;

            WfApprovalMatrixAdapter.Instance.Update(matrix);
        }
コード例 #9
0
 protected override void OnExecute(WfDesignerExecutorDataContext dataContext)
 {
     WfProcessDescriptorManager.SaveDescriptor(this.ProcessDescriptor);
 }
コード例 #10
0
        protected override void OnExecute(WfDesignerExecutorDataContext dataContext)
        {
            this._ImportedProcesses = WfProcessImporter.ImportProcessDescriptors(this.InputStream, this._NotifyEveryStep);

            dataContext["ImportedProcesses"] = this._ImportedProcesses;
        }
コード例 #11
0
 protected override void OnExecute(WfDesignerExecutorDataContext dataContext)
 {
     WfProcessDescriptorManager.ClearAll();
 }
コード例 #12
0
 /// <summary>
 /// 执行操作
 /// </summary>
 /// <param name="dataContext"></param>
 protected abstract void OnExecute(WfDesignerExecutorDataContext dataContext);
コード例 #13
0
 protected virtual void OnSaveUserOperationLogs(WfDesignerExecutorDataContext dataContext, UserOperationLogCollection logs)
 {
     logs.ForEach(log => UserOperationLogAdapter.Instance.InsertData(log));
 }