本文整理汇总了C#中IStep.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# IStep.Execute方法的具体用法?C# IStep.Execute怎么用?C# IStep.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStep
的用法示例。
在下文中一共展示了IStep.Execute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleStepExecution
/// <summary>
/// Handle normal step execution.
/// </summary>
/// <param name="step"></param>
/// <param name="execution"></param>
/// <param name="currentStepExecution"></param>
private void HandleStepExecution(IStep step, JobExecution execution, StepExecution currentStepExecution)
{
JobRepository.Add(currentStepExecution);
Logger.Info("Executing step: [ {0} ]", step.Name);
try
{
step.Execute(currentStepExecution);
currentStepExecution.ExecutionContext.Put("batch.executed", true);
}
catch (JobInterruptedException)
{
// Ensure that the job gets the message that it is stopping
// and can pass it on to other steps that are executing
// concurrently.
execution.Status = BatchStatus.Stopping;
throw;
}
JobRepository.UpdateExecutionContext(execution);
}
示例2: CreateTask
/// <summary>
/// Creates a task to be executed later on for the given stepExecution.
/// </summary>
/// <param name="step"></param>
/// <param name="stepExecution"></param>
/// <returns></returns>
protected Task<StepExecution> CreateTask(IStep step, StepExecution stepExecution)
{
return new Task<StepExecution>(() =>
{
step.Execute(stepExecution);
return stepExecution;
});
}