Call back methods in the BatchJobStepLocalInterface allow the common
batch container to run batch steps when it runs a batch job. Typically,
a batch step contains code to read a record from a batch data stream,
perform business logic with that record and then continue to read
the next batch container in a batch loop. This method contains all
the logic that can be batched to perform on data.
The following common batch container callback methods exist on
the BatchJobStepLocalInterface that are invoked by the common batch
container in the following ordered list:
- setProperties(java.util.Properties properties): Makes properties
defined in XML Job Control Language (xJCL) available to batch step
in a java.util.Properties object.
- void createJobStep(): Indicates to the step that it has been initialized.
Initialization logic, such as retrieving a handle to a batch data
stream, can be placed here.
- int processJobStep(): Repeatedly invoked by common batch container
in a batch loop until the return code integer of this method indicates
that the step has finished processing. Review BatchConstants in the
batch API to see which return codes can be returned. A return code
of BatchConstants.STEP_CONTINUE signals to the common batch container
to continue calling this method in the batch loop. A return code of
BatchConstants.STEP_COMPLETE indicates to the common batch container
that the step has finished, and destroyJobStep should be called.
- int destroyJobStep() - indicates to the step that completion has
occurred. The integer return code of this method is arbitrary and
can be chosen by the batch application developer. This return code
is saved in the common batch container database and represents the
return code of the batch step. If the results algorithm is associated
with the batch job, then this return code is passed to it. If there
is a return code-based conditional logic in the xJCL of the batch
job, then the common batch container uses this return code to evaluate
that logic.
The getProperties() method on the BatchJobStepLocalInterface is
not currently called by the common batch container. The method is
included in the interface for symmetry and possible later use.