GetJobExecution() public method

@see IFlowExecutor#GetJobExecution .
public GetJobExecution ( ) : JobExecution
return JobExecution
Ejemplo n.º 1
0
 /// <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);
     }
 }
Ejemplo n.º 2
0
 /// <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);
     }
 }