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¶
- Collection-based saves commit the active edit scope first by calling
ApplyEdit()before delegating to the framework save pipeline (BR-011). - On insert,
BeforeInsertcreates a data request forInsertSQLand binds all correspondence columns (SQL-002, ENDORSEMENT). AfterInsertinspects the returned row count and recordsInsertErrorinstead of marking the object old when the insert did not affect exactly one row (BR-012).- On update,
BeforeUpdatebinds:LastUpdateDate, restampsUpdateUserandUpdateDate, then binds the full column set for SQL-016 (BR-013). AfterUpdateuses the same one-row success rule as insert and records a DB-contention message on failure (BR-012).- Delete is not part of this operation because the criteria object throws
InvalidSQLPropertyfor 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.
Related documentation¶
Sources¶
Business\SAIF.Business.Policy.Correspondence\clsCorrespondence.vb