Skip to content

Retrieve an agency by sequence number

This operation executes the BOF retrieve lifecycle for clsAgency, loads one AGENCY row by AgencySeqNum, and returns a populated agency object or a default object when no row is found.

Field Value
Operation ID OP-001
Trigger A caller invokes clsAgency.GetAgency(inDataportal, inAgencySeqNum).
Inputs IDataPortalInfo, AgencySeqNum
Outputs clsAgency
Primary components clsAgency.GetAgency, clsAgency.Criteria, clsAgency.BeforeRetrieve, clsAgency.AfterRetrieve
Entry point Business\SAIF.Business.Policy.Agency\clsAgency.vb

Steps

  1. Build a clsAgency.Criteria instance with the portal context and requested agency sequence number (BR-002, BR-025).
  2. Pass the criteria to the BOF data portal so the retrieve lifecycle can execute on behalf of the agency object (BR-024).
  3. In BeforeRetrieve, assign SQL-001 and bind :AgencySeqNum against AGENCY.
  4. Execute the query and return a reader positioned for one agency row.
  5. In AfterRetrieve, call Fill only when a row exists; otherwise leave the object at its default state (BR-001).
  6. Mark the object old and expose its status, paperless, and naming helpers for later callers (BR-018, BR-019, BR-020).

Process flow

The following diagram visualizes the retrieve flow for one agency.

flowchart TD
  Start([GetAgency]) --> Criteria[Build criteria]
  Criteria --> SQL[Assign SQL-001]
  SQL --> Query[Query AGENCY]
  Query --> Found{Row found?}
  Found -->|Yes| Fill[Fill clsAgency]
  Found -->|No| Default[Return default object]
  Fill --> End([Agency returned])
  Default --> End

Failure and edge-case behavior

  • Missing rows return a default-initialized agency object instead of throwing a not-found exception.
  • Any caller that attempts to use persistence-oriented BOF SQL properties on the criteria hits the retrieve-only guard.

Sources

  • Business\SAIF.Business.Policy.Agency\clsAgency.vb