Batch job steps
Dividing a batch application into steps allows for separation of distinct tasks in a batch application. You can create batch steps by implementing the com.ibm.websphere.batch.BatchJobStepInterface interface, and then adding your business logic.
You can create batch job steps by creating a Java™ class that implements the com.ibm.websphere.batch.BatchJobStepInterface interface directly, or if your application is suited to a particular processing pattern, you can use a provided pattern class to reduce the amount of custom code you write.
- Generic Use this pattern if you are working with just one input Batch Data Stream and one output Batch Data Stream. During each iteration of the batch loop, this step reads a single entry from the input stream, and then passes it to the BatchRecordProcessor for processing. The BatchRecordProcessor returns the processed data, which is then passed to the BDS output stream. When you use this stream, you must provide the class that implements the BatchRecordProcessor interface. For more information, see Implementing the generic batch step (GenericXDBatchStep).
- Error tolerant Use this pattern if you are working with one input Batch Data Stream, one output Batch Data Stream, and one error Batch Data Stream. Each iteration of the batch loop reads a single entry from the input stream and passes it to the BatchRecordProcessor property for processing. The BatchRecordProcessor returns the processed data, which is then passed to the BDS output stream. If the BatchRecordProcessor returns a null value, the record that is read from the input stream is written to the error stream. When you use this stream, you must provide the class that implements the BatchRecordProcessor interface. For more information, see Implementing the error tolerant step (ThresholdBatchStep).
- Custom. To create your own pattern, write a class that directly implements the com.ibm.websphere.batch.BatchJobStepInterface interface.
For more information about batch job steps, see Batch job steps.
Included in this feature pack is a sample Java program, com.ibm.cics.batch.samples.CatalogManagerStockUpdate that demonstrates how to write a batch job step. The sample demonstrates how to read and update KSDS records using Batch data streams provided by CICS, and how to link to a CICS COBOL program to drive existing business logic. The COBOL source code is also provided.