Insert a policy output document¶
Persist a policy output-document record through the pk73343_output_document Oracle package.
| Field | Value |
|---|---|
| Operation ID | OP-007 |
| Trigger | Caller invokes InsertOutputDocument or InsertAgencyDeliveredOutputDocument on clsOutputDocumentInserter. |
| Inputs | An OutputDocumentInsert DTO containing policy, image, delivery, release, and description fields. |
| Outputs | A stored OUTPUT_DOCUMENT / POLICY_OUTPUT_DOCUMENT pair. |
| Primary components | clsOutputDocumentInserter.InsertOutputDocument; clsOutputDocumentInserter.InsertAgencyDeliveredOutputDocument |
| Entry point | Business\SAIF.Business.Policy.Correspondence\clsOutputDocumentInserter.vb |
Steps¶
- Build a non-query portal request for
pk73343_output_document.insert_policy_output_documentand bind the DTO values needed by the package (SQL-004). - The standard insert path binds the common fields; the agency-delivered path adds
in_agency_delivery_flag = Ybefore dispatching (BR-005, BR-031). - Inside the package, the core procedure computes the document create date, allowing an explicit release date to override the package default (BR-024).
- It inserts the base OUTPUT_DOCUMENT row and captures the generated key.
- It reads OUTPUT_DOCUMENT_TYPE_CODE to derive
RELE,HELD, orPENDstatus (BR-025, BR-026, BR-027). - It inserts the POLICY_OUTPUT_DOCUMENT row, normalizing zero agency or agent values to
NULLand settingRELEASE_DATEonly for released rows (BR-028, BR-029).Origin: These database-side sub-steps are implemented in pk73343_output_document.
- The 11-argument wrapper always delegates as a non-agency-delivered document, while the 12-argument wrapper passes the delivery flag through unchanged (BR-030, BR-031).
- Any package exception is re-raised through the SAIF standard error handler rather than being swallowed (BR-032).
Process flow¶
The following diagram summarizes the control flow for this operation.
flowchart TD
Start([Insert output document]) --> Bind[Bind DTO fields] --> Proc[Call SQL-004] --> Status[Derive RELE / HELD / PEND] --> Link[Insert policy link row] --> Return([Procedure completes])
Failure and edge-case behavior¶
- Validation and framework state errors surface through the BOF error collection unless the called dependency throws directly.
- Database-dependent operations rely on the caller-supplied data portal context and Oracle connectivity.
- Imaging reconciliation and stored-procedure wrappers defer cross-system behavior to their external collaborators.
Related documentation¶
Sources¶
Business\SAIF.Business.Policy.Correspondence\clsOutputDocumentInserter.vb