Skip to content

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

  1. Build a non-query portal request for pk73343_output_document.insert_policy_output_document and bind the DTO values needed by the package (SQL-004).
  2. The standard insert path binds the common fields; the agency-delivered path adds in_agency_delivery_flag = Y before dispatching (BR-005, BR-031).
  3. Inside the package, the core procedure computes the document create date, allowing an explicit release date to override the package default (BR-024).
  4. It inserts the base OUTPUT_DOCUMENT row and captures the generated key.
  5. It reads OUTPUT_DOCUMENT_TYPE_CODE to derive RELE, HELD, or PEND status (BR-025, BR-026, BR-027).
  6. It inserts the POLICY_OUTPUT_DOCUMENT row, normalizing zero agency or agent values to NULL and setting RELEASE_DATE only for released rows (BR-028, BR-029).

    Origin: These database-side sub-steps are implemented in pk73343_output_document.

  7. 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).
  8. 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.

Sources

  • Business\SAIF.Business.Policy.Correspondence\clsOutputDocumentInserter.vb