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.

Nesting jobs

Nesting jobs

From the course: Spring: Spring Batch

Start my 1-month free trial

Nesting jobs

- The job step is another strategy that Spring Batch provides to support re-usability. A job step lets us nest a job within a step and then execute that step from another job. This is a little different then defining a flow because instead of executing the sequence of steps directly inside of the job the job step will be executed as a separate job. We're going to take a look at how we can nest a job with a job step coming up. In order to support us, I've created a billing job that has a single invoice step and we're going to incorporate that as a nested job within our deliver package job. So we're going to package the item, execute our delivery flow and then as a separate job, we will execute our billing job. So lets take a quick look at our billing job and you'll notice that the billing job has one step, send to invoice. And if we look a little bit above our billing job you'll see that step. It's simply going to output…

Contents