/// <summary>
 /// Branches into a flow conditional on the outcome of the current step.
 /// </summary>
 /// <param name="pattern">a pattern for the exit status of the current step</param>
 /// <returns></returns>
 public FlowBuilder <FlowJobBuilder> .TransitionBuilder On(string pattern)
 {
     Assert.State(_steps.Count >= 0, "You have to start a job with a step");
     foreach (var step in _steps)
     {
         if (_builder == null)
         {
             _builder = new JobFlowBuilder(new FlowJobBuilder(this), step);
         }
         else
         {
             _builder.Next(step);
         }
     }
     return(_builder.On(pattern));
 }
 /// <summary>
 /// Splits, using the given task executor.
 /// </summary>
 /// <param name="executor"></param>
 /// <returns></returns>
 public JobFlowBuilder.SplitBuilder Split(ITaskExecutor executor)
 {
     foreach (IStep step in _steps)
     {
         if (_builder == null)
         {
             _builder = new JobFlowBuilder(new FlowJobBuilder(this), step);
         }
         else
         {
             _builder.Next(step);
         }
     }
     if (_builder == null)
     {
         _builder = new JobFlowBuilder(new FlowJobBuilder(this));
     }
     return(_builder.Split(executor));
 }