From the course: Spring: Spring Batch

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

StepExecutionListener

StepExecutionListener

From the course: Spring: Spring Batch

Start my 1-month free trial

StepExecutionListener

- [Instructor] In this lesson, we'll add a StepExecutionListener to a new Spring batch job that mimics the real-life task of preparing flowers for delivery. If we look at the logic for this job, we're going to first start out by selecting flowers. If the flowers do not have thorns, we're going to proceed to arrange them. However, if they do have thorns, we need to remove them and then begin the arrangement of our flowers. The StepExecutionListener that we'll be creating is going to determine whether or not the flowers have thorns so that we can appropriately proceed to the next step. So if we look at our linkedin.batch application class, you'll see that I have placed the configuration for our new job within it. So here we see the prepareFlowers job and currently, it's configured to run two steps, the selectFlowersStep and the arrangeFlowersStep. You'll see that the steps are defined higher up within our class…

Contents