SpepCompletionPolicy and implementations. A step can complete based on data exhaustion (no more chunks) or abnormally based on information the StepExecutor / ChunkProvider gets from the ChunkExecutor. See
BATCH-225 for details of what information will be available. Up to 1.0-m3 this decision was taken by the StepOperations CompletionPolicy, and actually that is probably a good place for it still to reside - the CompletionPolicy controls the data that it needs in its RepeatContext. Look at existing implementations of CompletionPolicy to understand the pattern.