自動建立目標表單資料時使其跳過發起節點
阿新 • • 發佈:2022-05-06
//狀態改為進行中 targetBo.Status = H3.DataModel.BizObjectStatus.Running; string instanceId = System.Guid.NewGuid().ToString(); if(string.IsNullOrEmpty(targetBo.WorkflowInstanceId)) targetBo.WorkflowInstanceId = instanceId; //目標表單建立須在目標表單建立之前獲取到WorkflowInstanceId ,並把狀態改為正在進行中targetBo.Create(); //對付款單進行流程操作,使其直接跳過發起人節點 H3.Workflow.Instance.WorkflowInstance wfInstance = this.Engine.WorkflowInstanceManager.GetWorkflowInstance(targetBo.WorkflowInstanceId); if(wfInstance == null) {//啟動流程 string workItemID = string.Empty; string errorMsg = string.Empty; H3.Workflow.Template.WorkflowTemplate wfTemp = this.Engine.WorkflowTemplateManager.GetDefaultWorkflow(targetBo.Schema.SchemaCode); this.Engine.Interactor.OriginateInstance(this.Request.UserContext.UserId, targetBo.Schema.SchemaCode, wfTemp.WorkflowVersion, targetBo.ObjectId, targetBo.WorkflowInstanceId, H3.Workflow.WorkItem.AccessMethod.Web, true, string.Empty, true, out workItemID, out errorMsg); }