Skip to content

Retrieve a set of agencies

This operation retrieves an agency collection, optionally filtering by FEID or by the existence of matching contract types.

Field Value
Operation ID OP-002
Trigger A caller invokes one of the clsAgencyCollection.GetAgencyCollection overloads.
Inputs IDataPortalInfo, optional FEID, optional List(Of AgencyContractTypes)
Outputs clsAgencyCollection
Primary components clsAgencyCollection.GetAgencyCollection, clsAgencyCollection.Criteria, BeforeRetrieve, AfterRetrieve
Entry point Business\SAIF.Business.Policy.Agency\clsAgencyCollection.vb

Steps

  1. Build the collection criteria that matches the requested overload: no filters, FEID filter, or contract-type filter list.
  2. Compose SQL-002 from the base agency query over AGENCY and, when needed, a correlated EXISTS against AGENCY_CONTRACT (BR-003, BR-004).
  3. Bind :FederalEmployerID only when the FEID path is used; contract-type codes are rendered as literals into the IN list.
  4. If no criteria were supplied, execute the unfiltered agency query (BR-005).
  5. Iterate the returned rows, create one clsAgency per row, and load each object into the collection.
  6. Position the collection on its first item and return it to the caller (BR-024).

Process flow

The following diagram visualizes the collection retrieve path.

flowchart TD
  Start([GetAgencyCollection]) --> Criteria[Build criteria]
  Criteria --> Filter{Filter type}
  Filter --> None[No WHERE clause]
  Filter --> FEID[Add FEID predicate]
  Filter --> Contract[Add EXISTS contract predicate]
  None --> Exec[Execute SQL-002]
  FEID --> Exec
  Contract --> Exec
  Exec --> Load[Load clsAgency rows]
  Load --> End([Collection returned])

Failure and edge-case behavior

  • The parameterless overload reads every agency row.
  • The contract-type filter uses literal interpolation for contract codes instead of parameter binding.

Sources

  • Business\SAIF.Business.Policy.Agency\clsAgencyCollection.vb
  • Business\SAIF.Business.Policy.Agency\clsAgencyContract.vb