public static IWfAbnormalAudit GetAbnormalAudit(WorkItem workItem) { if (workItem == null) { throw new WfException("WorkItem cannot be null"); } return new WfAbnormalAudit(workItem); }
public WfAbnormalAudit(WorkItem workItem) { this.dao = DaoUtil.GetDaoInstance("SkyMap.Net.Workflow"); string abnormalAuditId = workItem.AbnormalAuditId; if (StringHelper.IsNull(abnormalAuditId)) { this.CreateAbnormalAudit(workItem); } else { this.abnormalAuditInst = this.dao.Load(typeof(WfAbnormalAuditInst), abnormalAuditId) as WfAbnormalAuditInst; if (this.abnormalAuditInst == null) { throw new WfException("Cannot load the AbnormalAudit:" + workItem.AbnormalAuditId); } } }
public void CreateAbnormalAudit(WorkItem workItem) { this.abnormalAuditInst = new WfAbnormalAuditInst(); this.abnormalAuditInst.ActinstId = workItem.ActinstId; this.abnormalAuditInst.ActinstName = workItem.ActinstName; this.abnormalAuditInst.ProinstId = workItem.ProinstId; this.abnormalAuditInst.ProinstName = workItem.ProinstName; this.abnormalAuditInst.AssignId = workItem.AssignId; this.abnormalAuditInst.TimeStamp = new DateTime?(DateTimeHelper.GetNow()); this.abnormalAuditInst.NeedDecision = false; }
public static WorkItem GetWorkItem(DataRow row, string idField) { WorkItem item = new WorkItem(); item.ActdefId = GetColumnValue("ACTDEF_ID", row); item.ProinstId = GetColumnValue("PROINST_ID", row); item.ProinstName = GetColumnValue("PROINST_NAME", row); item.ActinstId = GetColumnValue("ACTINST_ID", row); item.ActinstName = GetColumnValue("ACTINST_NAME", row); item.AssignId = GetColumnValue("ASSIGN_ID", row); item.AbnormalAuditId = GetColumnValue("ABNORMALAUDIT_ID", row); item.ProjectId = GetColumnValue("PROJECT_ID", row); item.ProdefId = GetColumnValue("PRODEF_ID", row); if (idField != null) { item.Id = GetColumnValue(idField, row); } return item; }
public static void DelegateEvent(WorkItem workItem, WfClientAPIHandler handle) { Dictionary<string, WorkItem> workItems = new Dictionary<string, WorkItem>(1); workItems.Add(workItem.Id, workItem); handle(workItems); }
private static WfAbnormalType CheckCondition(WorkItem workItem) { string actinstId = workItem.ActinstId; string prodefId = workItem.ProdefId; string actdefId = workItem.ActdefId; Prodef prodef = WorkflowService.Prodefs[prodefId]; if (prodef != null) { Actdef actdef = prodef.Actdefs[actdefId]; if ((actdef != null) && (actdef.Froms.Count > 0)) { Transition transition = actdef.Froms[0]; SkyMap.Net.Workflow.XPDL.Application application = null; string typeName = string.Empty; IWfConditionApplication application2 = null; System.Type type = null; foreach (SkyMap.Net.Workflow.XPDL.Condition condition in transition.Conditions) { if (condition.Type.Equals("APPLICATION")) { application = condition.Application; if (application != null) { typeName = application.TypeClass + "," + application.Assembly; } type = System.Type.GetType(typeName); if (type != null) { application2 = Activator.CreateInstance(type) as IWfConditionApplication; if (application.ExecutionType) { int num = application2.IsOk(actinstId); try { return (WfAbnormalType) Enum.Parse(typeof(WfAbnormalType), num.ToString()); } catch (ArgumentException exception) { throw new WfClientException("Cannot know the return value of check condition : " + num.ToString(), exception); } } } } } } } return WfAbnormalType.NO_ABNORMAL; }
public static void PassToNext(WorkItem workItem, DataRowView row, IWfDialog wfDlg) { IDictionary<string, WorkItem> workItems = new Dictionary<string, WorkItem>(); workItems.Add(workItem.Id, workItem); PassToNext(workItems, new DataRowView[] { row }, wfDlg); }
private void SendBack(WorkItem workItem, IWfAssignment sendBackAssign, string sendBackActdefId) { if (sendBackAssign == null) { IList<WfAssigninst> list = this.Dao.Query<WfAssigninst>("GetSendBackToAssign", new object[] { workItem.ProinstId, sendBackActdefId }); if (list.Count == 0) { throw new CannotSendBackException("Cannot find the send to assignment for:" + workItem.AssignId + "," + workItem.ProinstName); } if (list.Count > 1) { throw new CannotSendBackException("Cannot batch send back the assignment:" + workItem.AssignId); } sendBackAssign = WfFactory.GetWfAssignment(list[0]); } IWfAssignment wfAssignment = WfFactory.GetWfAssignment(workItem.AssignId); if ((wfAssignment.AbnormalStatus == WfAbnormalType.NO_ABNORMAL) || (wfAssignment.AbnormalStatus == WfAbnormalType.SEND_BACKING)) { wfAssignment.SendBack(sendBackAssign); WfFactory.GetAbnormalAudit(workItem).Create(WfAbnormalType.SEND_BACKED); } }
public void Show(string viewContent, IWfDataForm dataForm, SkyMap.Net.Workflow.Engine.WorkItem workItem) { this.workItem = workItem; XtraTabPage[] pageArray = new XtraTabPage[] { this.pData, this.pNotion, this.pMaters, this.pAdjunct, this.pFlowInfo }; string[] strArray = new string[] { "业务数据", "经办人意见", "收件资料", "业务附件", "流程信息" }; string[] strArray2 = new string[] { "Workflow.WfView.DataTabPageImage", "Workflow.WfView.StaffNotionTabPageImage", "Workflow.WfView.MaterEditTabPageImage", "Workflow.WfView.MaterEditTabPageImage", "Workflow.WfView.AdjunctEditTabPageImage", "Workflow.WfView.FlowInfoTabPageImage" }; string[] strArray3 = new string[] { "pData", "pNotion", "pMaters", "pNotion", "pFlowInfo" }; for (int i = 0; i < strArray.Length; i++) { if (string.IsNullOrEmpty(viewContent) || (viewContent.IndexOf(strArray[i]) >= 0)) { if (pageArray[i] == null) { pageArray[i] = this.CreateTabPage(strArray3[i], strArray2[i], strArray[i]); switch (i) { case 0: this.pData = pageArray[i]; break; case 1: this.pNotion = pageArray[i]; break; case 2: this.pMaters = pageArray[i]; break; case 3: this.pAdjunct = pageArray[i]; break; case 4: this.pFlowInfo = pageArray[i]; break; } } if (!((pageArray[i] == null) || this.tblClient.TabPages.Contains(pageArray[i]))) { this.tblClient.TabPages.Add(pageArray[i]); } if (LoggingService.IsDebugEnabled) { LoggingService.DebugFormatted("将显示业务表单:{0}", new object[] { strArray[i] }); } continue; } if ((pageArray[i] != null) && this.tblClient.TabPages.Contains(pageArray[i])) { this.tblClient.TabPages.Remove(pageArray[i]); if (LoggingService.IsDebugEnabled) { LoggingService.DebugFormatted("将不显示业务表单:{0}", new object[] { strArray[i] }); } } } this.dataForm = dataForm; if (((this.pData != null) && this.tblClient.TabPages.Contains(this.pData)) && (dataForm is Control)) { Control control = dataForm as Control; if (control != null) { control.Dock = DockStyle.Fill; } this.pData.Controls.Clear(); this.pData.Controls.Add(control); dataForm.Changed += new EventHandler(this.currentUnitOfWork_Changed); } if (workItem != null) { this.Text = workItem.ProinstName + "-" + workItem.ProjectId; if (LoggingService.IsDebugEnabled) { LoggingService.DebugFormatted("正在显示业务ID:{0}, 业务编号:{1}, 业务名称:{2} 的业务表单", new object[] { workItem.ProinstId, workItem.ProinstName, workItem.ProjectId }); } Prodef prodef = WorkflowService.Prodefs[workItem.ProdefId]; if (((prodef == null) || (prodef.Type != "FLW")) && (((this.pFlowInfo != null) && this.tblClient.TabPages.Contains(this.pFlowInfo)) && (string.IsNullOrEmpty(viewContent) || (viewContent.IndexOf("流程信息") < 0)))) { this.tblClient.TabPages.Remove(this.pFlowInfo); } } if (this.tblClient.TabPages.Count > 0) { this.tblClient.SelectedTabPageIndex = 0; } if (base.toolStripContainer.TopToolStripPanel.Controls.Count > 0) { base.BarStatusUpdate(); } if (WorkbenchSingleton.MainForm != null) { base.Show(WorkbenchSingleton.MainForm); } else { base.Show(); } }
public void TerminateCompleted(WorkItem workItem) { Dictionary<string, WorkItem> workItems = new Dictionary<string, WorkItem>(); workItems.Add(workItem.AbnormalAuditId, workItem); this.TerminateCompleted(workItems); }
public void AbortDeleted(WorkItem workItem) { Dictionary<string, WorkItem> workItems = new Dictionary<string, WorkItem>(1); workItems.Add(workItem.AbnormalAuditId, workItem); this.AbortDeleted(workItems); }
public void Terminate(WorkItem workItem) { WfFactory.GetWfProcess(workItem.ProinstId).Terminate(); WfFactory.GetAbnormalAudit(workItem).Create(WfAbnormalType.TERMINATED); }
public void Suspend(WorkItem workItem) { WfFactory.GetWfProcess(workItem.ProinstId).Suspend(); WfFactory.GetAbnormalAudit(workItem).Create(WfAbnormalType.SUSPENDED); }
public void Resume(WorkItem workItem) { Dictionary<string, WorkItem> workItems = new Dictionary<string, WorkItem>(1); workItems.Add(workItem.AbnormalAuditId, workItem); this.Resume(workItems); }
public void Abort(WorkItem workItem) { WfFactory.GetWfProcess(workItem.ProinstId).Abort(); WfFactory.GetAbnormalAudit(workItem).Create(WfAbnormalType.ABROTED); }
public void CompleteWorkItem(WorkItem workItem) { if (LoggingService.IsDebugEnabled) { LoggingService.DebugFormatted("获取将设置完成的任务:{0}...", new object[] { workItem.AssignId }); } WfAssigninst assignInst = this.Dao.Load(typeof(WfAssigninst), workItem.AssignId) as WfAssigninst; this.CompleteWorkItem(assignInst); }