configuring at runtime seems not to work within spring batch semantics, e.g. the step in whole is created/configured at runtime, after that the reader, writer, processors, etc. should be ready, after all that is a the desired deterministic behaviour
maybe something like this would work:
Code:
<job id="job">
<step id="stepNormal" next="stepRenameFile" />
<step id="stepRenameFile" />
</job>
- stepNormal
- creates output-timestamp.txt
- saves "output-timestamp.txt" as "filename" in JobExecutionContext (*)
- saves desired ID as "id" in JobExecutionContext
- stepRenameFile (could be taskletstep)
- pulls "output-timestamp.txt" from JobExecutionContext
- pulls ID from JobExecutionContext
- creates desired filename foo-bar-ID.txt
- renames file
(*) http://static.springsource.org/spring-batch/reference/html-single/index.html#passingDataToFutureSteps