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.

Solution: Creating a conditional flow

Solution: Creating a conditional flow

From the course: Spring: Spring Batch

Start my 1-month free trial

Solution: Creating a conditional flow

(high energy music) - Let's take a look at one way to complete the challenge. In order to solve the challenge, you needed to create two steps. One to thank the customer and one to give them a refund. So I'm going to go ahead and copy our LeaveAtDoorStep and I'll place that step within our class twice. And then I'm going to go ahead and modify it so that we have a refund step. And we'll just need to change the name of our method and then we'll change the console output and then we'll also create our Thank the Customer step. So the refund step will be executed when we have given the customer the incorrect item and the thank the customer step will be executed when we've given them the correct item. And then we'll change the console output here. Okay, so we have our two steps. Now we need to create a new job execution decider, so I'm going to create a new class and I'm going to name that class ReceiptDecider. And that class…

Contents