//状态改为进行中
                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);
                }

 

posted on 2022-05-06 09:24  天涯何  阅读(42)  评论(0编辑  收藏  举报