Skip to content

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

  1. Invoke the delete. Caller triggers the delete lifecycle on a clsXDocumentCollection instance whose XPrintControlSeqNum identifies the batch to clear.
  2. Execute the delete. Criteria.DeleteSQL defines SQL-021 (DELETE XDOCUMENT WHERE XPRINT_CONTROL_SEQ_NUM = :XPrintControlSeqNum, XDOCUMENT).
  3. No BeforeDelete override exists in clsXDocumentCollection in 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.**
  4. Check the outcome. AfterDelete reads the rows-affected result and checks RowsAffected <> 1, adding DeleteError ("Delete Failed") when the check fails (BR-001).
  5. 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 BeforeDelete override is present for clsXDocumentCollection, 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 AfterDelete contention 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 clsXDocument class.

Note: Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • Services\SAIF.Services.Printing.Remote\clsXDocumentCollection.vb