Print-control batch header lifecycle¶
clsXPrintControl represents the header record for a print-control batch, stored in XPRINT_CONTROL. It captures the output directory, duplex mode, processed date, IDM (imaging) path, XML file name, and MD5 hash for a set of documents queued together. This operation covers the header's full CRUD lifecycle. Unlike the deferred print queue, XPRINT_CONTROL has no live sequence generation — XPrintControlSeqNum must be supplied by the caller.
| Field | Value |
|---|---|
| Operation ID | OP-002 |
| Trigger | Caller creates a header (NewXPrintControl, directly or via Create a print batch with documents); caller retrieves a header by sequence number (GetXPrintControl); caller updates header fields and saves; caller deletes a header |
| Inputs | XPrintControlSeqNum (caller-supplied), directory name, duplex mode, processed date, IDM path name, XML file name, MD5 hash |
| Outputs | Inserted, updated, or removed row in XPRINT_CONTROL; populated clsXPrintControl on retrieve; error message on row-count contention |
| Primary components | clsXPrintControl.Create, clsXPrintControl.BeforeInsert/AfterInsert, clsXPrintControl.BeforeRetrieve/AfterRetrieve, clsXPrintControl.BeforeUpdate/AfterUpdate, clsXPrintControl.BeforeDelete/AfterDelete, clsXPrintControl.DuplexMode |
| Entry point | Services\SAIF.Services.Printing.Remote\clsXPrintControl.vb |
Steps¶
- Create a header. Caller invokes
clsXPrintControl.NewXPrintControl(inDataportal, inXPrintControlSeqNum).Create()simply copiesXPrintControlSeqNumfrom the criteria — no sequence is generated procedurally, so the caller must supply a unique value. - The
IDMPathNamebacking field defaults to"PROMPT"at construction, indicating the imaging destination path is not yet resolved (BR-006). - Persist the header.
BeforeInsertbinds 7 parameters (directory name, duplex code, processed date, sequence number, IDM path name, XML file name, MD5 hash) and executes SQL-007 (INSERT INTO XPRINT_CONTROL ..., XPRINT_CONTROL). The duplex mode is translated from theDuplexModesenum to one of four fixed 5-character codes before binding (BR-004). AfterInsertchecksRowsAffected <> 1and addsInsertErroron contention (BR-001).- Retrieve a header by key. Caller invokes
clsXPrintControl.GetXPrintControl(inSeqNum).BeforeRetrievebinds:XPrintControlSeqNumand executes SQL-013 (SELECT ... FROM XPRINT_CONTROL WHERE XPRINT_CONTROL_SEQ_NUM = :XPrintControlSeqNum, XPRINT_CONTROL). AfterRetrievereads the single-rowclsSAIFDataReaderand callsFill()to populate the object, then marks it old (not dirty).- Update a header. Caller modifies header properties (marking the object dirty) and saves.
BeforeUpdatebinds the same seven columns, plusXPrintControlSeqNuma second time for theWHEREpredicate, and executes SQL-017 (UPDATE XPRINT_CONTROL SET ..., XPRINT_CONTROL). AfterUpdatechecksRowsAffected <> 1and addsUpdateErroron contention (BR-001).- Delete a header. Caller invokes the delete lifecycle on a
clsXPrintControlinstance.BeforeDeletebinds:XprintControlSeqNumand executes SQL-022 (DELETE XPRINT_CONTROL WHERE XPRINT_CONTROL_SEQ_NUM = :XPrintControlSeqNum, XPRINT_CONTROL). AfterDeletechecksRowsAffected <> 1and addsDeleteErroron contention (BR-001).- Duplex mode translation (cross-cutting). The
DuplexModeproperty getter maps a stored code to theDuplexModesenum (DEFLT,HORIZ→HORIZONTAL,VERTL→VERTICAL,SIMPL→SIMPLEX); the setter performs the reverse mapping when a caller assigns aDuplexModesvalue. Any stored code that does not match one of the four recognized values falls through the getter with no explicitReturn, yielding an implicit default value rather than an error.** (BR-004)
Process flow¶
The following diagram visualizes the four CRUD actions available on the print-control batch header.
flowchart TD
Start([Caller selects an action]) --> Which{Which action?}
Which -->|Create| Seq[Create: copy caller-supplied<br>XPrintControlSeqNum]
Seq --> Ins[Insert into XPRINT_CONTROL]
Ins --> InsCheck{RowsAffected = 1?}
InsCheck -->|No| InsErr([InsertError added])
InsCheck -->|Yes| InsOk([Header created])
Which -->|Retrieve| Ret[Select by XPrintControlSeqNum]
Ret --> Fill[Fill object from reader,<br>mark old]
Which -->|Update| Upd[Update all mutable columns<br>by seq num]
Upd --> UpdCheck{RowsAffected = 1?}
UpdCheck -->|No| UpdErr([UpdateError added])
UpdCheck -->|Yes| UpdOk([Header updated])
Which -->|Delete| Del[Delete by XPrintControlSeqNum]
Del --> DelCheck{RowsAffected = 1?}
DelCheck -->|No| DelErr([DeleteError added])
DelCheck -->|Yes| DelOk([Header removed])
Failure and edge-case behavior¶
XPRINT_CONTROLhas no live sequence generation in this library —XPrintControlSeqNummust be supplied by the caller; the commented-outCreateSQLscalar (DIRECTORY_NAME_NEXTVAL, dead SQL-003 on the collection class) is a CodeGen2 template artifact, not a real Oracle sequence.*DuplexMode's getter has noReturnfor an unrecognized stored code — VB semantics yield the default enum value (SIMPLEX, ordinal 0) implicitly rather than raising an error.**- All four CRUD actions add an error message uniformly on
RowsAffected <> 1, unlike the deferred print queue's delete path, which has this check commented out. - Two other Insert/Update/Delete
Criteriaproperties exist on the sibling collection class (clsXPrintControlCollection) but are dead/unwired from anyBefore*method: SQL-008 (Insert) and SQL-018 (Update).
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.
Related documentation¶
Sources¶
Services\SAIF.Services.Printing.Remote\clsXPrintControl.vb