BATCH-1069: Added section to Step chapter about standalone steps.
This commit is contained in:
@@ -123,6 +123,44 @@
|
||||
directly passed from the reader to the writer.</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Referencing a Standalone Step</title>
|
||||
|
||||
<para>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:</para>
|
||||
|
||||
<programlisting>
|
||||
<job id="sampleJob">
|
||||
<step id="step1" <emphasis role="bold">ref="standaloneStep"</emphasis> />
|
||||
</job>
|
||||
|
||||
<step id="standaloneStep" job-repository="jobRepository" transaction-manager="transactionManager">
|
||||
<tasklet reader="itemReader" writer="itemWriter" commit-interval="10"/>
|
||||
</step>
|
||||
|
||||
</programlisting>
|
||||
|
||||
<para>It should be noted that the id attribute is still required on the
|
||||
step within the job element. This is for two reasons:</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>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.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>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.</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>The Commit Interval</title>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user