Retrieve print-control batches pending processing¶
This operation loads the set of print-control batch headers that still need attention: those not yet marked processed by a given cutoff date, or those that have simply gone stale regardless of processed status. It is the collection-level counterpart to the single-header retrieval in Print-control batch header lifecycle.
| Field | Value |
|---|---|
| Operation ID | OP-004 |
| Trigger | Caller invokes clsXPrintControlCollection.GetXprintControlCollection(inProcessedDate) |
| Inputs | Processed-date cutoff |
| Outputs | Collection of clsXPrintControl matching the pending/stale criteria |
| Primary components | clsXPrintControlCollection.BeforeRetrieve, clsXPrintControlCollection.AfterRetrieve |
| Entry point | Services\SAIF.Services.Printing.Remote\clsXPrintControlCollection.vb |
Steps¶
- Set up the retrieval criteria. Caller invokes
GetXprintControlCollection(inDataportal, inProcessedDate).Criteria.NewsetsProcessedDatefrom the argument and computesThirtyDaysAgoDate = Today.AddDays(-30). - Bind and execute the query.
BeforeRetrievebinds both:ProcessedDateand:ThirtyDaysAgoDateand executes SQL-014 (SELECT ... FROM XPRINT_CONTROL WHERE PROCESSED_DATE < :ProcessedDate OR CREATE_DATE < :ThirtyDaysAgoDate, XPRINT_CONTROL) — a batch is included when it is explicitly unprocessed by the supplied cutoff, or when it is simply stale by create date regardless of processed status (BR-003). - Load the matching rows.
AfterRetrieveiterates theIDataReader, constructing aclsXPrintControlper row viaLoad()/Fill()and adding each to the collection.
Process flow¶
The following diagram visualizes the pending/stale batch retrieval.
flowchart TD
Start([Caller supplies ProcessedDate cutoff]) --> Calc[Compute ThirtyDaysAgoDate<br>= Today - 30 days]
Calc --> Query[Query XPRINT_CONTROL WHERE<br>ProcessedDate < cutoff<br>OR CreateDate < 30 days ago]
Query --> Load[Load each matching row<br>into the collection]
Load --> End([Collection returned to caller])
Failure and edge-case behavior¶
- A batch that has never been processed and is also older than 30 days matches both conditions in the
ORclause, but is only returned once (no duplicate rows). - A recently created but already-processed batch (processed date on or after the cutoff, and created within 30 days) is correctly excluded from the pending set.
- The 30-day staleness window is a hard-coded default (
Today.AddDays(-30)) with no caller override, unlike the processed-date cutoff which is caller-supplied.
Related documentation¶
Sources¶
Services\SAIF.Services.Printing.Remote\clsXPrintControlCollection.vb