protected virtual void OnAfterExecute(WfDesignerExecutorDataContext dataContext) { if (this.AfterExecute != null) { this.AfterExecute(dataContext); } }
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)); } }
protected virtual void OnError(System.Exception ex, WfDesignerExecutorDataContext dataContext, ref bool autoThrow) { if (this.Error != null) { this.Error(ex, dataContext, ref autoThrow); } }
protected virtual void FirePrepareUserOperationLog(WfDesignerExecutorDataContext dataContext, UserOperationLogCollection logs) { if (this.PrepareUserOperationLog != null) { this.PrepareUserOperationLog(dataContext, logs); } }
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); }
protected override void OnExecute(WfDesignerExecutorDataContext dataContext) { using (TransactionScope scope = TransactionScopeFactory.Create()) { SOARolePropertyDefinitionAdapter.Instance.Delete(this.MatrixID); SOARolePropertiesAdapter.Instance.Delete(this.MatrixID); scope.Complete(); } }
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); }
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); }
protected override void OnExecute(WfDesignerExecutorDataContext dataContext) { WfProcessDescriptorManager.SaveDescriptor(this.ProcessDescriptor); }
protected override void OnExecute(WfDesignerExecutorDataContext dataContext) { this._ImportedProcesses = WfProcessImporter.ImportProcessDescriptors(this.InputStream, this._NotifyEveryStep); dataContext["ImportedProcesses"] = this._ImportedProcesses; }
protected override void OnExecute(WfDesignerExecutorDataContext dataContext) { WfProcessDescriptorManager.ClearAll(); }
/// <summary> /// 执行操作 /// </summary> /// <param name="dataContext"></param> protected abstract void OnExecute(WfDesignerExecutorDataContext dataContext);
protected virtual void OnSaveUserOperationLogs(WfDesignerExecutorDataContext dataContext, UserOperationLogCollection logs) { logs.ForEach(log => UserOperationLogAdapter.Instance.InsertData(log)); }