public void BeginStepExecute(StepConfig stepConfig, int priority, string workflowName, WorkflowContent content, IUnitOfData context) { StringBuilder sb = new StringBuilder(); content.SaveStringBuilder(sb); // throw new System.NotImplementedException(); WorkflowDbContext wfContent = context as WorkflowDbContext; //ATAW_WORKFLOWContext wfContent = context as ATAW_WORKFLOWContext; WF_WORKFLOW_INST inst = new WF_WORKFLOW_INST(); inst.WI_ID = wfContent.GetUniId(); inst.WI_CONTENT_XML = sb.ToString(); inst.WI_NAME = workflowName; wfContent.WF_WORKFLOW_INST.Add(inst); //步骤基本信息 StepUtil.SetWorkflowByStep(inst, stepConfig.Name, stepConfig.DisplayName, wfContent.Now, (int)stepConfig.StepType, (int)StepState.ProcessNotSend); inst.WI_INDEX = 1; inst.WI_PRIORITY = priority; //扩展信息 //父子流程 //主表控制 content.SetAllMainRow(wfContent, stepConfig, inst.WI_ID); }
protected override bool Execute() { BeginStepConfig stepConfig = Config as BeginStepConfig; Creator creator = AtawIocContext.Current.FetchInstance <Creator>(stepConfig.CreatorRegName); creator.Parameter = Parameter; creator.Workflow = Workflow; WorkflowContent content = creator.CreateContent(Source); StringBuilder sb = new StringBuilder(); content.SaveStringBuilder(sb); // throw new System.NotImplementedException(); WorkflowDbContext wfContent = Source as WorkflowDbContext; //ATAW_WORKFLOWContext wfContent = context as ATAW_WORKFLOWContext; WorkflowRow.WI_CONTENT_XML = sb.ToString(); creator.CreateWorkflowName(Source); WorkflowRow.WI_NAME = creator.WorkflowName; creator.UpdateWorkflowRow(Source); wfContent.WF_WORKFLOW_INST.Add(WorkflowRow); //步骤基本信息 StepUtil.SetWorkflowByStep(WorkflowRow, stepConfig.Name, stepConfig.DisplayName, wfContent.Now, (int)stepConfig.StepType, (int)StepState.ProcessNotSend); WorkflowRow.WI_INDEX = 1; WorkflowRow.WI_PRIORITY = (int)creator.Priority; //扩展信息 //父子流程 //主表控制 content.SetAllMainRow(wfContent, stepConfig, WorkflowRow.WI_ID); Source.Submit(); return(true); }