abstract class EnsLib.RecordMap.SimpleBatch
extends EnsLib.RecordMap.Batch
Simplistic Batch implementation to allow for rapid development of batches
with a simple, deterministic batch header and trailer structure
Note that the RecordMap framework will automatically define a relationship called Records
to the Record type contained in the batch. The RECORDMAPGENERATED parameter should be set to 0 if this
automatic update should not occur.
parameter BatchHeader;
Contents of the Batch Header
parameter BatchTrailer;
Contents of the Batch Trailer
parameter HeaderTerm;
The terminator (if any) for the Batch Header. Hex values preceded by \x should be
used for control characters.
parameter IgnoreLeadingData = 0;
Parameter to control whether warnings should be logged when leading data is found before the Batch Header characters.
parameter TrailerTerm;
The terminator (if any) for the Batch Trailer. Hex values preceded by \x should be
used for control characters.
property BatchHeader
as %String(MAXLEN="",XMLPROJECTION="NONE") [ InitialExpression = ..#BatchHeader _ ..GetHeaderTerm() ];
Property used to contain the Batch Header and terminators for output.
This allows for easy manipulation of the output, if needed.
property BatchTrailer
as %String(MAXLEN="",XMLPROJECTION="NONE") [ InitialExpression = ..#BatchTrailer _ ..GetTrailerTerm() ];
Property used to contain the Batch Trailer and terminators for output.
This allows for easy manipulation of the output, if needed.
classmethod GetBatchHeader(pIOStream As %IO.DeviceStream, pTimeout As %Numeric = -1, Output pBatch As EnsLib.RecordMap.SimpleBatch, ByRef pLookAhead As %String)
as %Status
Get the Batch Header from an incoming stream. This is only invoked once by the RecordMap
batch services when a new stream is passed in. Any extra data must be returned in pLookAhead
for use in parsing the first record.
classmethod GetBatchTrailer(pIOStream As %IO.DeviceStream, pTimeout As %Numeric = -1, Output pFound As %Boolean, pBatch As EnsLib.RecordMap.SimpleBatch, ByRef pLookAhead As %String)
as %Status
Check for the Batch Trailer. The RecordMap batch services will invoke this method on every
record in a file after the Batch Header is found.
classmethod GetHeaderTerm()
as %String
classmethod GetTrailerTerm()
as %String
method PutBatchHeader(pIOStream As %IO.DeviceStream)
as %Status
Write out the Batch Header for the current Batch object
method PutBatchTrailer(pIOStream As %IO.DeviceStream)
as %Status
Write out the Batch Trailer for the current Batch object