How to call another step within an chunk process in Spring Batch?
Is the following possible/advisable with Spring Batch?

I have a csv file, say foo.csv. I set up a chunk process that reads the file into Foo objects and then processes them into Bar objects. Finally these are written into a file bars.csv.

>foos.csv ----[IR]----> Foo ---- [IP]-----> Bar ------[IW]----> bars.csv
>
>where IR stands for ItemReader, IP for ItemProcessor and IW for ItemWriter

Now I want to further process the Bar object, turn it into a Baz object and do some other stuff with it, e.g. write it into a file bazs.csv or so.

>foos.csv ----[IR]----> Foo ---- [IP 1]-----> Bar ------[IW 1]----> bars.csv<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;---- [IP 2]-----> Baz ------[IW 2] ----> bazs.csv

Or,even better

>foos.csv ----[IR]----> Foo ---- [IP 1]-----> Bar ------[IW 1]----> bars.csv<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;----- [IW 2] ---->[Next Step]

>where we repeatedly call the next step <b>within</b> the iteration, thereby passing the next Bar object. In this next step we could then do the conversion to Baz.


So in summary: Is it possible to call a step from within a chunk process? Is it a good idea? If not, what are the alternatives?

How to call another step within an chunk process in Spring Batch?
===

Is the following possible/advisable with Spring Batch?

I have a csv file, say foo.csv. I set up a chunk process that reads the file into Foo objects and then processes them into Bar objects. Finally these are written into a file bars.csv.

>foos.csv ----[IR]----> Foo ---- [IP]-----> Bar ------[IW]----> bars.csv
>
>where IR stands for ItemReader, IP for ItemProcessor and IW for ItemWriter

Now I want to further process the Bar object, turn it into a Baz object and do some other stuff with it, e.g. write it into a file bazs.csv or so.

>foos.csv ----[IR]----> Foo ---- [IP 1]-----> Bar ------[IW 1]----> bars.csv<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;---- [IP 2]-----> Baz ------[IW 2] ----> bazs.csv

Or,even better

>foos.csv ----[IR]----> Foo ---- [IP 1]-----> Bar ------[IW 1]----> bars.csv<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;----- [IW 2] ---->[Next Step]

>where we repeatedly call the next step <b>within</b> the iteration, thereby passing the next Bar object. In this next step we could then do the conversion to Baz.


So in summary: Is it possible to call a step from within a chunk process? Is it a good idea? If not, what are the alternatives?
