Employee directory retrieval¶
This operation returns lists of employees for directory-style use cases. clsEmployeeDataCollection reuses the same base employee query used by single-record lookups, then appends a literal predicate that matches the requested directory slice.
| Field | Value |
|---|---|
| Operation ID | OP-SB-02 |
| Trigger | Caller invokes one of the collection factory methods such as GetEmployeeDataByDepartment or GetAllEmployeeData. |
| Inputs | Query type, query value, include-virtual flag |
| Outputs | clsEmployeeDataCollection |
| Primary components | clsEmployeeDataCollection.GetEmployeeDataByDepartment, clsEmployeeDataCollection.Criteria.BeforeRetrieve, clsEmployeeDataCollection.AfterRetrieve |
| Entry point | Business\SAIF.Business\clsEmployeeDataCollection.vb |
Steps¶
- The caller selects a query type such as department, title, location, active employees, or all employees and packages the query value inside
Criteria(BR-SB-011). BeforeRetrievestarts from the shared employee SQL template and appends the query-type-specific predicate directly onto the statement, such asDepartmentName = ...,JobTitle = ...,Location = ..., orActiveInd = 1(BR-SB-011, SQL-026, ADP_EMPLOYEE).- When the caller requested the all-employees variant with virtual rows enabled, the criteria appends the
UNION ALLvirtual-employee branch so the directory contains both ADP andVIRTUAL_EMPLOYEErecords (SQL-026, VIRTUAL_EMPLOYEE). - The data portal runs the finished SQL and returns the result set as directory rows (SQL-026, ADP_EMPLOYEE, VIRTUAL_EMPLOYEE).
AfterRetrievecreates oneclsEmployeeDataobject per row, loads its fields from the result set, and appends it to the collection.- Collection helpers such as
GetByEmployeeID,Contains, andRemoveByEmployeeIDoperate only against the in-memory list built in the previous step.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Collection request]) --> Type[Choose query type]
Type --> Build[Append literal filter predicate]
Build --> Virtual{Include virtual employees?}
Virtual -->|Yes| Union[Append virtual union]
Virtual -->|No| Query[Run ADP query]
Union --> Query
Query --> Hydrate[Hydrate employee objects]
Hydrate --> End([Return collection])
Failure and edge-case behavior¶
- A query type with no matching rows returns an empty collection rather than raising an application error.
- Virtual employees appear only on the all-employees path that explicitly enables the union branch.
- The directory filters are concatenated as literals, so the exact filter shape is determined entirely by the selected query type and supplied value (BR-SB-011).
Related documentation¶
Sources¶
Business\SAIF.Business\clsEmployeeData.vbBusiness\SAIF.Business\clsEmployeeDataCollection.vb