Skip to content

Persist group associations (insert / update / delete)

Persists group master data and enforces the row-count checks used by both singular and collection save paths.

Field Value
Operation ID OP-003
Trigger Caller saves a group association or the collection
Inputs —
Outputs Rows persisted or generic/contention errors added to the object or collection.
Primary components clsGroupAssociation and clsGroupAssociationCollection persistence overrides
Entry point Business\SAIF.Business.Policy.Group\clsGroupAssociation.vb

Steps

  1. BeforeInsert binds every GROUP_ASSOCIATION column (:Code, :Name, :EffectiveDate, :GroupTypeCode, :GroupPlanCode, :GroupRenewalDate, :PMSGroupNumber, address block, :CreateDate, :CreateUser, :UpdateDate, :UpdateUser (30), :PMSGroupSubCode, :GroupEnrollForm (5), :CodeAcronym (5), endorsement codes, flags) and executes INSERT INTO GROUP_ASSOCIATION.
  2. AfterInsert checks RowsAffected; if <> 1 it calls AddErrorMessage("InsertError", "Insert Failed"), otherwise MarkOld(). (BR-009)
  3. BeforeUpdate binds the same columns plus the concurrency key and executes UPDATE GROUP_ASSOCIATION; AfterUpdate raises AddErrorMessage("UpdateError", Messages.DBContentionError) when RowsAffected <> 1, otherwise MarkOld(). (BR-009, BR-010)
  4. BeforeDelete executes DELETE GROUP_ASSOCIATION ... WHERE; AfterDelete raises AddErrorMessage("DeleteError", Messages.DBContentionError) when the row count is wrong, otherwise calls MarkNew() — the deleted instance is returned to the new state rather than discarded. (BR-011)
  5. The collection variants report generic "Delete Failed" / "Insert Failed" / "Update Failed" messages instead of the contention message. (BR-012)
  6. Database statements executed or relied on by this operation: SQL-002, SQL-003, SQL-010, SQL-011, SQL-030, SQL-031, SQL-038, SQL-039; affected tables: DUAL, GROUP_ASSOCIATION.
  7. The update and delete variants SQL-030, SQL-031, SQL-038, and SQL-039 are truncated at a bare Where.
  8. Inherited BOF save behavior validates the object or collection, executes the configured criteria SQL, and surfaces row-count failures back on the business object before the caller continues.†

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Trigger]) --> Step1[Build criteria / load state]
    Step1 --> Step2[Apply local business logic]
    Step2 --> Decision{Valid and complete?}
    Decision -->|Yes| Step3[Return data or persist rows]
    Decision -->|No| EndErr([Return BOF validation or SQL-state issues])
    Step3 --> EndOk([Operation completes])

Failure and edge-case behavior

  • Collection persistence surfaces generic "Insert Failed" / "Update Failed" / "Delete Failed" messages through BR-012.

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 † were retrieved from dependency library documentation via the Legends CLI RAG service.

Sources

  • Business\SAIF.Business.Policy.Group\clsGroupAssociation.vb