From the course: Spring: Spring Batch

Unlock the full course today

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

Building jobs with multiple steps

Building jobs with multiple steps

From the course: Spring: Spring Batch

Start my 1-month free trial

Building jobs with multiple steps

- [Instructor] Batch jobs normally contain more than a single step. The execution of most jobs flows sequentially from one step to another until the job completes. When configuring a job with multiple steps, the job builder interface allows us to define transitions from one step to another to create a multi-step job. Let's add a few more steps to the delivery job to see these transitions. We'll need to drive the package to the customer's address in the process of completing our package delivery job. So let's create a new step in order to include the action of driving to the customer's address. I'm going to name the method for this bean driveToAddressStep and then, just like before, we'll use the stepBuilderFactory to create a new step named driveToAddressStep and then we're going to create a tasklet and within this tasklet, we're going to add the logic we would like to execute while driving to the address. We're going to…

Contents