Skip to content

SAIF.Services.Printing.Remote business rules

This page captures business rules enforced by this library.

BR-001: Row-count contention check

Field Value
Statement Every insert, update, and delete operation checks that exactly one row was affected; if RowsAffected <> 1, an error message is added to signal a contention or unexpected state.
Trigger Completion of any AfterInsert, AfterUpdate, or AfterDelete lifecycle method across all six business objects.
Enforcement Each After* method inspects RowsAffected and calls AddErrorMessage(...) when the count is not exactly 1. Implemented in clsXDeferredPrint.vb, clsXDeferredPrintCollection.vb, clsXDocument.vb, clsXPrintControl.vb, clsXPrintControlCollection.vb. Note: clsXDeferredPrint.AfterDelete has its contention check commented out — no live post-delete validation applies for single-item deferred print deletes.*
Outcome The calling layer receives an error condition when a write does not affect exactly one row, enabling the consumer to handle concurrency conflicts or data-integrity violations.
Tables XDEFERRED_PRINT, XPRINT_CONTROL, XDOCUMENT
SQL SQL-004, SQL-006, SQL-007, SQL-015, SQL-017, SQL-019, SQL-021, SQL-022, SQL-023
Source Services\SAIF.Services.Printing.Remote\clsXDeferredPrint.vb, Services\SAIF.Services.Printing.Remote\clsXDocument.vb, Services\SAIF.Services.Printing.Remote\clsXPrintControl.vb, Services\SAIF.Services.Printing.Remote\clsXPrintControlCollection.vb

BR-002: Deferred print retention/eligibility rule

Field Value
Statement A deferred print item is eligible for retrieval when its PrintedDate is before a supplied cutoff date, or when its CreateDate is more than 30 days old — regardless of print status.
Trigger Retrieval of clsXDeferredPrintCollection using RetrieveType = byDate.
Enforcement clsXDeferredPrintCollection.Criteria.New(inDataportal, inPrintedDate) computes ThirtyDaysAgoDate = Today.AddDays(-30). BeforeRetrieve appends WHERE PRINTED_DATE < :PrintedDate OR CREATE_DATE < :ThirtyDaysAgoDate to the base RetrieveSQL text (SQL-010, Variant A).
Outcome Stale or previously processed items become selectable for cleanup or reprocessing regardless of their current print status.
Tables XDEFERRED_PRINT
SQL SQL-010
Source Services\SAIF.Services.Printing.Remote\clsXDeferredPrintCollection.vb

BR-003: Print-control batch staleness rule

Field Value
Statement A print-control batch is selected for the pending-processing collection when PROCESSED_DATE < :ProcessedDate or CREATE_DATE < :ThirtyDaysAgoDate (30-day-old default).
Trigger Retrieval of clsXPrintControlCollection via GetXprintControlCollection(inProcessedDate).
Enforcement clsXPrintControlCollection.Criteria.New sets ThirtyDaysAgoDate = Today.AddDays(-30). BeforeRetrieve binds both date parameters to SQL-014 (WHERE PROCESSED_DATE < :ProcessedDate OR CREATE_DATE < :ThirtyDaysAgoDate).
Outcome Both explicitly unprocessed batches (by processed date) and stale batches (by create date, regardless of processed status) are included in the pending collection, enabling cleanup of abandoned batches.
Tables XPRINT_CONTROL
SQL SQL-014
Source Services\SAIF.Services.Printing.Remote\clsXPrintControlCollection.vb

BR-004: Duplex mode controlled vocabulary

Field Value
Statement clsXPrintControl.DuplexMode translates between the DuplexModes enum (DEFLT, HORIZONTAL, VERTICAL, SIMPLEX) and fixed 5-character database codes (DEFLT, HORIZ, VERTL, SIMPL). Any stored code not matching these four values has no explicit getter return.**
Trigger Reading or writing clsXPrintControl.DuplexMode property; inserting or updating XPRINT_CONTROL.DUPLEX_CODE.
Enforcement The DuplexMode property getter maps stored codes to enum values via Select Case; an unrecognized code falls through with no Return, yielding an implicit VB default.** The setter translates the enum to a fixed code string for DuplexCode storage. Controlled vocabulary also appears on clsXDocument.DuplexCode and clsXDeferredPrint.DuplexCode (stored as the same 5-character codes but without explicit translation logic in those classes).*
Outcome Only the four defined duplex modes are reliably persisted and retrieved. An unrecognized stored code may result in an implicit default enum value (SIMPLEX, ordinal 0) rather than an explicit error.**
Tables XPRINT_CONTROL, XDOCUMENT, XDEFERRED_PRINT
SQL SQL-007, SQL-011, SQL-012
Source Services\SAIF.Services.Printing.Remote\clsXPrintControl.vb, Services\SAIF.Services.Printing.Remote\Enums.vb

BR-005: Default bin type on document creation

Field Value
Statement New clsXDocument instances default XBinTypeCode to "AUTO" and CopiesCount to 1, routing to an auto-selected print bin and printing a single copy unless explicitly overridden.
Trigger Invocation of clsXDocument.Create() lifecycle method.
Enforcement The Create() method sets XBinTypeCode = "AUTO" and CopiesCount = 1 before any caller-supplied values are applied. These defaults flow into SQL-006 via the :XBinTypeCode and :CopiesCount parameters in BeforeInsert.
Outcome Documents that do not explicitly set a bin type or copy count are routed to the auto-selected bin with a single copy, preventing null or zero values from reaching the database.
Tables XDOCUMENT
SQL SQL-006
Source Services\SAIF.Services.Printing.Remote\clsXDocument.vb

BR-006: IDM path default

Field Value
Statement clsXPrintControl.IDMPathName defaults to "PROMPT", indicating that a document imaging (IDM) destination path is not pre-set and must be resolved or prompted by a downstream consumer.**
Trigger Construction or creation of a clsXPrintControl instance without an explicit IDMPathName value.
Enforcement The IDMPathName property (or its backing field) is initialized to "PROMPT" in the object's create/initialization path.* The "PROMPT" value flows into SQL-007 via :IDMPathName when BeforeInsert runs.
Outcome Downstream consumers that read IDMPathName = "PROMPT" are expected to substitute a real IDM path; an unresolved "PROMPT" value in the database indicates an incomplete or pending imaging setup.**
Tables XPRINT_CONTROL
SQL SQL-007
Source Services\SAIF.Services.Printing.Remote\clsXPrintControl.vb

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • Services\SAIF.Services.Printing.Remote\clsXDeferredPrint.vb
  • Services\SAIF.Services.Printing.Remote\clsXDeferredPrintCollection.vb
  • Services\SAIF.Services.Printing.Remote\clsXDocument.vb
  • Services\SAIF.Services.Printing.Remote\clsXPrintControl.vb
  • Services\SAIF.Services.Printing.Remote\clsXPrintControlCollection.vb
  • Services\SAIF.Services.Printing.Remote\Enums.vb