---
title: SAIF.Business.Policy.Correspondence architecture
summary: Architectural responsibilities, boundaries, and interaction patterns.
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Correspondence
reference_type: package
---

# SAIF.Business.Policy.Correspondence architecture

`SAIF.Business.Policy.Correspondence` is a mid-tier VB.NET BOF library that sits between consuming policy applications and Oracle-backed correspondence data. It combines framework-derived lifecycle behavior† with local correspondence logic, one Oracle document-output integration path, and one external Imaging API dependency.

## Responsibilities
- Model correspondence and endorsement rows stored in `ENDORSEMENT`.
- Read correspondence-code metadata and read-only detail-element rows.
- Hand off policy output-document creation to the `pk73343_output_document` Oracle package.
- Reconcile local image references with the Imaging API.

## Component boundaries
- No UI, service host, or program entry point is defined in this library.
- Persistence flows through `IDataPortalInfo` and the inherited BOF data-portal lifecycle†.
- The only outbound network dependency is `ImagingClient`, created from the `ImagingApiUrl` setting.
- Stored-procedure integration is isolated behind `clsOutputDocumentInserter` and the legacy `clsCorrespondence.InsertOutputLog` helper.

## Interaction model
- Static factory methods create or retrieve business objects and collections.
- Nested criteria classes assemble Oracle SQL and route requests through the BOF data portal†.
- `clsEndorsement` and `clsEndorsementCollection` shadow the base retrieve SQL to add endorsement-only filters and policy-period rules.
- `clsEndorsementCollection` caches a shared `ImagingClient`, so endpoint changes require a process restart to take effect.*

## Architecture diagram
The following diagram shows the library's high-level runtime collaborators.

```mermaid
flowchart TD
    A[Consuming policy applications] --> B[SAIF.Business.Policy.Correspondence]
    B --> C[SAIF.BOF.Business
constants and code collections]
    B --> D[SAIF.Framework.Core
data portal and BOF base classes]
    B --> E[(Oracle tables and procedures)]
    B --> F[ImagingAPI.Client]
    F --> G[(Imaging API)]
```

## Sequence diagram
The following diagram shows the image-reconciliation path.

```mermaid
sequenceDiagram
    participant Caller
    participant Collection as clsEndorsementCollection
    participant Env as EnvironmentService
    participant Imaging as ImagingClient
    Caller->>Collection: ClearImageSequenceNumbersForDeletedImages()
    Collection->>Env: GetConfigSetting("ImagingApiUrl")
    Env-->>Collection: Imaging API base URL
    Collection->>Imaging: GetImages(POLICY, imageIds)
    Imaging-->>Collection: Existing image IDs
    Collection->>Collection: Reset missing IDs to 0
    Collection-->>Caller: Updated collection
```

## Design constraints
- Correspondence rows do not expose delete support through the criteria API.
- Detail rows are read-only in live code.
- Endorsement collection period logic differs for Guidewire and non-Guidewire policy periods.
- The Imaging API client is cached in a shared field, so endpoint changes take effect only after restart.*

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Dependencies](dependencies.md)
- [Operations and processes](operations-processes.md)
- [Business rules](business-rules.md)
- [Database tables](database-tables.md)
- [SQL catalog](sql/index.md)
- [Configuration](configuration.md)
- [API reference](api/index.md)




> **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.
> Statements marked with † are derived from dependency library documentation via the Legends CLI.

## Sources
- `Business\SAIF.Business.Policy.Correspondence\SAIF.BOF.Business.Policy.Correspondence.vbproj`
- `Business\SAIF.Business.Policy.Correspondence\SAIF.BOF.Business.Policy.Correspondence.nuspec`
- `Business\SAIF.Business.Policy.Correspondence\packages.config`
- `Business\SAIF.Business.Policy.Correspondence\app.config`
- `Business\SAIF.Business.Policy.Correspondence\Web.config`
- `Business\SAIF.Business.Policy.Correspondence\clsCorrespondence.vb`
- `Business\SAIF.Business.Policy.Correspondence\clsCorrespondenceCode.vb`
- `Business\SAIF.Business.Policy.Correspondence\clsCorrespondenceCollection.vb`
- `Business\SAIF.Business.Policy.Correspondence\clsCorrespondenceDetail.vb`
- `Business\SAIF.Business.Policy.Correspondence\clsCorrespondenceDetailCollection.vb`
- `Business\SAIF.Business.Policy.Correspondence\clsEndorsement.vb`
- `Business\SAIF.Business.Policy.Correspondence\clsEndorsementCollection.vb`
- `Business\SAIF.Business.Policy.Correspondence\clsOutputDocumentInserter.vb`
