Implementation of IFlowExecutor for use in components that need to execute a flow related to a JobExecution.
Inheritance: IFlowExecutor, IDisposable
コード例 #1
0
ファイル: FlowStep.cs プロジェクト: sangkyunyoon/SummerBatch
 /// <summary>
 /// Delegates to the flow provided for the execution of the step.
 /// </summary>
 /// <param name="stepExecution"></param>
 /// <exception cref="System.Exception"></exception>
 protected override void DoExecute(StepExecution stepExecution)
 {
     try
     {
         stepExecution.ExecutionContext.Put(StepConstants.StepTypeKey, GetType().Name);
         IStepHandler  stepHandler = new SimpleStepHandler(JobRepository, stepExecution.ExecutionContext);
         IFlowExecutor executor    = new JobFlowExecutor(JobRepository, stepHandler, stepExecution.JobExecution);
         executor.UpdateJobExecutionStatus(Flow.Start(executor).Status);
         stepExecution.UpgradeStatus(executor.GetJobExecution().Status);
         stepExecution.ExitStatus = executor.GetJobExecution().ExitStatus;
     }
     catch (FlowExecutionException e)
     {
         if (e.InnerException is JobExecutionException)
         {
             throw e.InnerException;
         }
         throw new JobExecutionException("Flow execution ended unexpectedly", e);
     }
 }
コード例 #2
0
ファイル: FlowJob.cs プロジェクト: SummerBatch/SummerBatch
 /// <summary>
 /// @see AbstractJob#DoExecute .
 /// </summary>
 /// <param name="execution"></param>
 /// <exception cref="JobExecutionException">&nbsp;</exception>
 protected override void DoExecute(JobExecution execution)
 {
     try
     {
         JobFlowExecutor executor =
             new JobFlowExecutor(JobRepository,
             new SimpleStepHandler(JobRepository),
             execution);
         executor.UpdateJobExecutionStatus(Flow.Start(executor).Status);
     }
     catch (FlowExecutionException e)
     {
         var exception = e.InnerException as JobExecutionException;
         if (exception != null)
         {
             throw exception;
         }
         throw new JobExecutionException("Flow execution ended unexpectedly", e);
     }
 }
コード例 #3
0
 /// <summary>
 /// @see AbstractJob#DoExecute .
 /// </summary>
 /// <param name="execution"></param>
 /// <exception cref="JobExecutionException">&nbsp;</exception>
 protected override void DoExecute(JobExecution execution)
 {
     try
     {
         JobFlowExecutor executor =
             new JobFlowExecutor(JobRepository,
                                 new SimpleStepHandler(JobRepository),
                                 execution);
         executor.UpdateJobExecutionStatus(Flow.Start(executor).Status);
     }
     catch (FlowExecutionException e)
     {
         var exception = e.InnerException as JobExecutionException;
         if (exception != null)
         {
             throw exception;
         }
         throw new JobExecutionException("Flow execution ended unexpectedly", e);
     }
 }
コード例 #4
0
ファイル: FlowStep.cs プロジェクト: pkubryk/SummerBatch
 /// <summary>
 /// Delegates to the flow provided for the execution of the step.
 /// </summary>
 /// <param name="stepExecution"></param>
 /// <exception cref="System.Exception"></exception>
 protected override void DoExecute(StepExecution stepExecution)
 {
     try
     {
         stepExecution.ExecutionContext.Put(StepConstants.StepTypeKey, GetType().Name);
         IStepHandler stepHandler = new SimpleStepHandler(JobRepository, stepExecution.ExecutionContext);
         IFlowExecutor executor = new JobFlowExecutor(JobRepository, stepHandler, stepExecution.JobExecution);
         executor.UpdateJobExecutionStatus(Flow.Start(executor).Status);
         stepExecution.UpgradeStatus(executor.GetJobExecution().Status);
         stepExecution.ExitStatus = executor.GetJobExecution().ExitStatus;
     }
     catch (FlowExecutionException e)
     {
         if (e.InnerException is JobExecutionException)
         {
             throw e.InnerException;
         }
         throw new JobExecutionException("Flow execution ended unexpectedly", e);
     }
 }