Skip to content

Persist a correspondence or endorsement

Insert or update a correspondence row through the BOF save lifecycle.

Field Value
Operation ID OP-004
Trigger Caller saves a clsCorrespondence, clsEndorsement, or their collection wrappers.
Inputs A dirty correspondence object plus any edit-session state held by the framework.
Outputs An inserted or updated ENDORSEMENT row or a recorded error.
Primary components clsCorrespondence.BeforeInsert, clsCorrespondence.AfterInsert, clsCorrespondence.BeforeUpdate, clsCorrespondence.AfterUpdate
Entry point Business\SAIF.Business.Policy.Correspondence\clsCorrespondence.vb

Steps

  1. Collection-based saves commit the active edit scope first by calling ApplyEdit() before delegating to the framework save pipeline (BR-011).
  2. On insert, BeforeInsert creates a data request for InsertSQL and binds all correspondence columns (SQL-002, ENDORSEMENT).
  3. AfterInsert inspects the returned row count and records InsertError instead of marking the object old when the insert did not affect exactly one row (BR-012).
  4. On update, BeforeUpdate binds :LastUpdateDate, restamps UpdateUser and UpdateDate, then binds the full column set for SQL-016 (BR-013).
  5. AfterUpdate uses the same one-row success rule as insert and records a DB-contention message on failure (BR-012).
  6. Delete is not part of this operation because the criteria object throws InvalidSQLProperty for delete and create-SQL access (BR-014).

Process flow

The following diagram summarizes the control flow for this operation.

flowchart TD
    Start([Save request]) --> Edit[ApplyEdit] --> Mode{Insert or update?} -->|Insert| Insert[Run SQL-002] --> Check[RowsAffected = 1?] --> Return([Mark old or add error])
    Mode -->|Update| Update[Run SQL-016] --> Check

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\clsCorrespondence.vb