예제 #1
0
 private Workflow(string workflowId, IUnitOfData workflowSource)
     : this(workflowSource)
 {
     //Source = workflowSource;
     WorkflowDbContext dbContext = workflowSource as WorkflowDbContext;
     WF_WORKFLOW_INST  row       = dbContext.WF_WORKFLOW_INST.FirstOrDefault(a => a.WI_ID == workflowId);
     AtawDebug.AssertNotNull(row, "该流程已处理或异常,请进历史页面查看", this);
     WorkflowId  = row.WI_ID;
     WorkflowRow = row;
     Config      = WorkflowConfig.GetByName(row.WI_WD_NAME, workflowSource);
     //WorkflowConfig.ConnString =
     StepConfig stepConfig = Config.Steps[row.WI_CURRENT_STEP];
     if (stepConfig != null)
     {
         CurrentStep  = stepConfig.CreateStep(this);
         CurrentState = CurrentStep.GetState(row.WI_STATUS.Value <StepState>());
     }
     else
     {
         throw new AtawException("不存在的步骤" + row.WI_CURRENT_STEP, this);
     }
 }