Exemplo n.º 1
0
 /// <summary>
 /// @see IState#Handle .
 /// </summary>
 /// <param name="executor"></param>
 /// <returns></returns>
 /// <exception cref="Exception">&nbsp;</exception>
 public override FlowExecutionStatus Handle(IFlowExecutor executor)
 {
     // On starting a new step, possibly upgrade the last execution to make
     // sure it is abandoned on restart if it failed.
     executor.AbandonStepExecution();
     return(new FlowExecutionStatus(executor.ExecuteStep(Step)));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Returns the FlowExecutionStatus stored.
 /// @see IState#Handle
 /// </summary>
 /// <param name="executor"></param>
 /// <returns></returns>
 /// <exception cref="Exception">&nbsp;</exception>
 public override FlowExecutionStatus Handle(IFlowExecutor executor)
 {
     lock (executor)
     {
         // Special case. If the last step execution could not complete we
         // are in an unknown state (possibly unrecoverable).
         StepExecution stepExecution = executor.GetStepExecution();
         if (stepExecution != null && executor.GetStepExecution().BatchStatus == BatchStatus.Unknown)
         {
             return(FlowExecutionStatus.Unkown);
         }
         if (Status.IsStop())
         {
             if (!executor.IsRestart())
             {
                 //If there are step executions, then we are not at the
                 // beginning of a restart.
                 if (Abandon)
                 {
                     // Only if instructed to do so, upgrade the status of
                     // last step execution so it is not replayed on a
                     // restart...
                     executor.AbandonStepExecution();
                 }
             }
             else
             {
                 // If we are a stop state and we got this far then it must
                 // be a restart, so return COMPLETED.
                 return(FlowExecutionStatus.Completed);
             }
         }
         SetExitStatus(executor, Code);
         return(Status);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// @see IState#Handle .
 /// </summary>
 /// <param name="executor"></param>
 /// <returns></returns>
 /// <exception cref="Exception"></exception>
 public override FlowExecutionStatus Handle(IFlowExecutor executor)
 {
     // On starting a new step, possibly upgrade the last execution to make
     // sure it is abandoned on restart if it failed.
     executor.AbandonStepExecution();
     return new FlowExecutionStatus(executor.ExecuteStep(Step));
 }
Exemplo n.º 4
0
        /// <summary>
        /// Returns the FlowExecutionStatus stored.
        /// @see IState#Handle
        /// </summary>
        /// <param name="executor"></param>
        /// <returns></returns>
        /// <exception cref="Exception">&nbsp;</exception>
        public override FlowExecutionStatus Handle(IFlowExecutor executor)
        {
            lock (executor)
            {
                // Special case. If the last step execution could not complete we
                // are in an unknown state (possibly unrecoverable).
                StepExecution stepExecution = executor.GetStepExecution();
                if (stepExecution != null && executor.GetStepExecution().BatchStatus == BatchStatus.Unknown)
                {
                    return FlowExecutionStatus.Unkown;
                }
                if (Status.IsStop())
                {
                    if (!executor.IsRestart())
                    {
                         //If there are step executions, then we are not at the
                         // beginning of a restart.                     
                        if (Abandon)
                        {
                             // Only if instructed to do so, upgrade the status of
                             // last step execution so it is not replayed on a
                             // restart...
                            executor.AbandonStepExecution();
                        }
                    }
                    else
                    {
                         // If we are a stop state and we got this far then it must
                         // be a restart, so return COMPLETED.
                        return FlowExecutionStatus.Completed;
                    }
                }
                SetExitStatus(executor, Code);
                return Status;

            }
        }