Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: Tim MeagherHi,
There isn't anyway to reset the input to read the data from the first record again.
The reason for this is that while the node API obscures this, the data coming in the input doesn't need to be from a file or from something that is complete at the time of reading.
Rather, if you are running the LAE using the external controller (or with a BRX/LXA) and using streaming mode, the data could be coming directly from an upstream node as that node is processing records.
In the current implementation of that streaming mechanism, the upstream node would communicate via a socket connection to the downstream node, so it needs the downstream node to consume the data before it continues. There would also be no way to reset the streamed data and tell the upstream node to start sending records again.
There are ideas about enhancing this to allow for a multi-pass input or something similar which would further mask the streaming behavior, meaning that you could reset and start reading from the first record again (or "mark" the input, and reset to the marked position) - however that is not currently available.
Instead, you would need to save off the records you have processed to a temporary file.
In order to do this you should look at section 9.1.3 of the Java Node Getting Started Guide - "Writing to External BRD Files" - which will allow you to construct a record output.
You can then use the RecordOutput to write the records to a temp directory location (look at the information on the fileManager in section 9.1) you could then construct a RecordInput over that location to be able to reprocess the records when you need to reset.
Hope this helps somewhat.
Tim.