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¶
- Build the collection criteria that matches the requested overload: no filters, FEID filter, or contract-type filter list.
- Compose SQL-002 from the base agency query over AGENCY and, when needed, a correlated
EXISTSagainst AGENCY_CONTRACT (BR-003, BR-004). - Bind
:FederalEmployerIDonly when the FEID path is used; contract-type codes are rendered as literals into theINlist. - If no criteria were supplied, execute the unfiltered agency query (BR-005).
- Iterate the returned rows, create one
clsAgencyper row, and load each object into the collection. - 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.
Related documentation¶
Sources¶
Business\SAIF.Business.Policy.Agency\clsAgencyCollection.vbBusiness\SAIF.Business.Policy.Agency\clsAgencyContract.vb