Implementation of IFlowExecutor for use in components that need to execute a flow related to a JobExecution.
Inheritance: IFlowExecutor, IDisposable
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>
 /// @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);
     }
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 4
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);
     }
 }