Example #1
0
 public static void Next(FlowProcess flow, FlowTask nexTask = null)
 {
     if (flow == null)
     {
         throw new ArgumentNullException("flow");
     }
     if (nexTask == null)
     {
         flow.Status = (int)FlowStatus.Complete;
         flow.CompleteTime = flow.SetupTime;
         flow.CurrentHandleUrl = string.Empty;
         flow.CurrentTaskSection = string.Empty;
         flow.CurrentHandler = null;
     }
     else
     {
         flow.Status = (int)FlowStatus.Processing;
         flow.CurrentHandleUrl = nexTask.HandleUrl;
         flow.CurrentTaskSection = nexTask.SectionName;
         flow.CurrentHandler = nexTask.Handler;
     }
 }
Example #2
0
 public static FlowProcess CreateProcess(FlowTask firstTask, FlowTask nexTask, string flowName)
 {
     if (firstTask == null)
     {
         throw new ArgumentNullException("firstTask");
     }
     if (string.IsNullOrWhiteSpace(flowName))
     {
         throw new ArgumentNullException("flowName");
     }
     FlowProcess flow = new FlowProcess
     {
         Name = flowName,
         SetupTime = DateTime.Now
     };
     if (nexTask == null)
     {
         flow.Status = (int)FlowStatus.Complete;
         flow.CompleteTime = flow.SetupTime;
     }
     else
     {
         flow.Status = (int)FlowStatus.Start;
         flow.CurrentHandleUrl = nexTask.HandleUrl;
         flow.CurrentTaskSection = nexTask.SectionName;
         flow.CurrentHandler = nexTask.Handler;
         nexTask.FlowProcess = flow;
     }
     firstTask.HandleTime = flow.SetupTime;
     firstTask.FlowProcess = flow;
     return flow;
 }