H3.DataModel.BizObjectSchema schema =this.Request.Engine.BizObjectManager.GetPublishedSchema("D000001InspectIssue");
H3.DataModel.BizObject iReport = new H3.DataModel.BizObject(this.Request.Engine, schema,this.Request.UserContext.UserId,this.Request.UserContext.User.ParentId);
iReport["IssueReportName"] = "关于****的整改报告";
string instanceId = System.Guid.NewGuid().ToString();
if (string.IsNullOrEmpty(iReport.WorkflowInstanceId)) iReport.WorkflowInstanceId = instanceId ;
iReport.Create(); //创建对象
H3.Workflow.Instance.WorkflowInstance wfInstance =this.Request.Engine.WorkflowInstanceManager.GetWorkflowInstance(iReport.WorkflowInstanceId);
if (wfInstance == null)
{
//启动流程
string workItemID = string.Empty;
string errorMsg = string.Empty;
H3.Workflow.Template.WorkflowTemplate wfTemp =this.Request.Engine.WorkflowTemplateManager.GetDefaultWorkflow(iReport.Schema.SchemaCode);
this.Request.Engine.Interactor.OriginateInstance(this.Request.UserContext.UserId, iReport.Schema.SchemaCode,
wfTemp.WorkflowVersion, iReport.ObjectId, iReport.WorkflowInstanceId, H3.Workflow.WorkItem.AccessMethod.Web,
true, string.Empty, true, out workItemID, out errorMsg);
}//第七个参数 false/true 为是否提交流程操作
如何创建带流程表单,同时发起流程
于 2024-05-26 23:56:25 首次发布