Processing a Single Record ID

The core processing of the stream takes place in this method, implemented in processRecord. This method gets BatchProcessingID and batchProcessParameters as parameters and is expected to return a BatchProcessingResult instance containing the encoded results of it's processing, see Encoding Batch Summary Information for further details.

If an unrecoverable technical error is encountered when processing the record passed into this method an exception should be thrown. This will cause the batch streaming infrastructure to add this ID to a skip list, roll back the transaction and re-start the processing of the current chunk. This method will not be called for an record IDs on the skipped list. Examples of unrecoverable technical errors would include database errors or errors writing to third party systems. The key point to consider is the expectation that the error is transient i.e. that there is a reasonable chance that it will not recur the next time the processing is run. It is also possible that the chunker may retry the skipped records once all the streams have completed, for more information, see Processing Skipped Cases

Given that only a count of skipped IDs will be reported and that the records will be re-processed on the next run of the batch program, careful consideration needs to be given to any unrecoverable business errors detected. It may make more sense to modify the business state of the governing business object, for example suspending the case, and informing a user so they can take corrective action, via a task sent to the case owner. Examples of unrecoverable business errors would include incomplete or invalid data. Note that errors like this will only be resolved by the intervention of a knowledgeable user.

One class of unrecoverable business error requires special consideration: where there is invalid or incomplete configuration data. In this instance we would expect this to effect many (if not all) of the records to be processed. But by acting to modify the business state of the governing business object and individually informing users, the impact on the business might be very bad - imagine 1,000,000 suspended cases and individual tasks for users! In this instance it is better to treat such issues in the same way as unrecoverable technical errors.