diff --git a/docs/src/site/docbook/reference/step.xml b/docs/src/site/docbook/reference/step.xml index de4f3cb93..10fd3001e 100644 --- a/docs/src/site/docbook/reference/step.xml +++ b/docs/src/site/docbook/reference/step.xml @@ -123,6 +123,44 @@ directly passed from the reader to the writer. +
+ Referencing a Standalone Step + + While steps must exist within a Job to define the flow, it can + sometimes be useful to reference a 'standalone' Step. For example, if a + Step is used by multiple jobs it can be useful to declare it once and + reference it from multiple jobs. This can be achieved with the ref + attribute: + + + <job id="sampleJob"> + <step id="step1" ref="standaloneStep" /> + </job> + + <step id="standaloneStep" job-repository="jobRepository" transaction-manager="transactionManager"> + <tasklet reader="itemReader" writer="itemWriter" commit-interval="10"/> + </step> + + + + It should be noted that the id attribute is still required on the + step within the job element. This is for two reasons: + + + + The Id will be used as the step name when persisting the + StepExecution, if the same standalone step is referenced in more + than one step in the job, an error will occur. + + + + When creating job flows, as described later in this chapter, + the next attribute should be referring to the step in the flow, not + the standalone step. + + +
+
The Commit Interval