/// <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))); }
/// <summary> /// Returns the FlowExecutionStatus stored. /// @see IState#Handle /// </summary> /// <param name="executor"></param> /// <returns></returns> /// <exception cref="Exception"> </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); } }
/// <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)); }
/// <summary> /// Returns the FlowExecutionStatus stored. /// @see IState#Handle /// </summary> /// <param name="executor"></param> /// <returns></returns> /// <exception cref="Exception"> </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; } }