Delete documents for a batch¶
This operation bulk-removes all documents associated with a print-control batch, used for cleanup once the batch has been printed. It operates at the collection level and has no per-document counterpart — individual documents are never deleted on their own in this library.
| Field | Value |
|---|---|
| Operation ID | OP-006 |
| Trigger | Caller invokes the delete lifecycle on a clsXDocumentCollection instance with XPrintControlSeqNum set |
| Inputs | XPrintControlSeqNum |
| Outputs | Rows removed from XDOCUMENT; error message on row-count contention |
| Primary components | clsXDocumentCollection.AfterDelete, clsXDocumentCollection.Criteria.DeleteSQL |
| Entry point | Services\SAIF.Services.Printing.Remote\clsXDocumentCollection.vb |
Steps¶
- Invoke the delete. Caller triggers the delete lifecycle on a
clsXDocumentCollectioninstance whoseXPrintControlSeqNumidentifies the batch to clear. - Execute the delete.
Criteria.DeleteSQLdefines SQL-021 (DELETE XDOCUMENT WHERE XPRINT_CONTROL_SEQ_NUM = :XPrintControlSeqNum, XDOCUMENT). - No
BeforeDeleteoverride exists inclsXDocumentCollectionin this library's source — the request's construction and parameter binding for this delete depend on undocumented base-class (clsBusinessCollectionBase) default wiring that could not be verified from this library's own code.** - Check the outcome.
AfterDeletereads the rows-affected result and checksRowsAffected <> 1, addingDeleteError("Delete Failed") when the check fails (BR-001). - Note: for a batch with more than one document, deleting "all documents for a batch" will affect more than one row by design, yet the check only tolerates exactly
1; whether this check is meaningful for a genuinely multi-document batch (versus always firing as a false-positive contention error) could not be confirmed from source.**
Process flow¶
The following diagram visualizes the batch document cleanup.
flowchart TD
Start([Caller triggers delete on<br>clsXDocumentCollection with XPrintControlSeqNum]) --> Exec[Execute DELETE XDOCUMENT<br>WHERE XPrintControlSeqNum = value]
Exec --> Check{RowsAffected = 1?}
Check -->|No| Err([DeleteError added —<br>fires for 0 or 2+ rows alike])
Check -->|Yes| Ok([Documents removed])
Failure and edge-case behavior¶
- No
BeforeDeleteoverride is present forclsXDocumentCollection, so the exact request construction and parameter binding for this delete cannot be confirmed from this library's own source — it relies on base-class default behavior.** - The
AfterDeletecontention check tests for exactly one row affected, which does not naturally accommodate deleting a genuinely multi-document batch; its practical behavior for batches with more than one document is unconfirmed.** - This is the only way documents are removed in this library — there is no live delete path on the single-document
clsXDocumentclass.
Note: Statements marked with
**could not be confirmed; treat as unknown until verified.
Related documentation¶
Sources¶
Services\SAIF.Services.Printing.Remote\clsXDocumentCollection.vb