//public static void FinishStep(Workflow workflow, WorkflowContent content, EndStepConfig config, // IUnitOfData source, BaseProcessor processor) //{ // FinishType finishType = FinishType.Normal; // if (config.EnableModify) // { // finishType = FinishType.ModifiedNormal; // } // FinishData result = FinishStep(workflow, finishType, // workflow.WorkflowRow["WI_PROCESS_ID"], content); // source.Submit(); //} public static void SetWorkflowByStep(IUnitOfData source, WF_WORKFLOW_INST workflowRow, StepConfig nextStep) { workflowRow.WI_LAST_STEP = workflowRow.WI_CURRENT_STEP; workflowRow.WI_LAST_STEP_NAME = workflowRow.WI_CURRENT_STEP_NAME; WorkflowInstUtil.SetWorkflowByStep(workflowRow, nextStep); nextStep.Prepare(workflowRow, source); }
public static bool BackStep(Workflow workflow, StepConfig backStep) { var workflowRow = workflow.WorkflowRow; var source = workflow.Source as WorkflowDbContext; var stepInst = GetBackStep(workflow, backStep); var newStepInst = new WF_STEP_INST(); source.WF_STEP_INST.Add(newStepInst); CopyWorkflowToStep(source, workflow.WorkflowRow, newStepInst, FlowAction.Back); CopyManualInfo(workflow.WorkflowRow, newStepInst); //回退步骤 修改接收人列表 和 接收人个数 //从步骤实例表中查询上次接收的人 workflowRow.WI_INDEX = stepInst.SI_INDEX; workflowRow.WI_RECEIVE_ID = stepInst.SI_RECEIVE_ID;//上次接收的人 workflowRow.WI_RECEIVE_LIST = QuoteIdList.GetQuoteId(stepInst.SI_RECEIVE_ID); workflowRow.WI_RECEIVE_COUNT = 1; workflowRow.WI_SEND_ID = GlobalVariable.UserId.ToString(); workflowRow.WI_SEND_DATE = source.Now; workflowRow.WI_LAST_MANUAL = stepInst.SI_LAST_MANUAL; workflowRow.WI_LAST_MANUAL_NAME = stepInst.SI_LAST_MANUAL_NAME; workflowRow.WI_LAST_STEP = stepInst.SI_LAST_STEP; workflowRow.WI_LAST_STEP_NAME = stepInst.SI_LAST_STEP_NAME; workflowRow.WI_CURRENT_CREATE_DATE = DateTime.Now; // stepInst.SI_VALID_FLAG = 1; WorkflowInstUtil.ClearError(workflowRow); WorkflowInstUtil.SetWorkflowByStep(workflowRow, backStep); WorkflowContent workflowContent = WorkflowInstUtil.CreateContent(workflow.WorkflowRow); workflowContent.SetMainRowStatus(source, backStep); backStep.Prepare(workflowRow, source); source.Submit(); return(true); }