Retrieve the service team and derive email addresses¶
Loads the team of SAIF staff assigned to service a policy (underwriter, loss-control consultant, etc.) and resolves each member's email address, which may require a cross-database (BDS/SQL Server) lookup.
| Field | Value |
|---|---|
| Operation ID | op-05-retrieve-service-team |
| Trigger | Consumer reads TeamAssignmentCollection |
| Inputs | Policy number, optional inMaskData flag |
| Outputs | clsTeamAssignmentCollection |
| Primary components | clsTeamAssignmentCollection.GetTeamAssignmentCollection, InitializeEmailAddress, clsTeamAssignment.InitializeEmailAddress |
| Entry point | SAIF.Business.View.Policy/clsTeamAssignmentCollection.vb |
Steps¶
- Caller invokes
GetTeamAssignmentCollection(inDataportal, inPolicyNum[, inMaskData]), which constructs aCriteriaand delegates toinDataportal.DataAccessLayer.RetrieveObject. A second overload additionally accepts a SQL Server data portal but delegates identically to the first (SQL-031, procedurepk72846_view_policy.team_assign_query). - Framework invokes
BeforeRetrieve: creates a newIDataRequest, assignsMyCriteria.RetrieveSQL, setsCommandType = StoredProcedure, and binds parameters (policy number and mask-data flag from the criteria). - Framework executes the request against Oracle.
- Framework invokes
AfterRetrieve: loopsReader.Read, and for each row constructs aNew clsTeamAssignment, setsTeamAssignment.MaskData = MyCriteria.MaskData(BR-VP-010), callsTeamAssignment.Load(Reader), and adds it viaMyBase.Add. TeamFunctionToCode/CodeToTeamFunctiontranslate between theTeamFunctionsenum (e.g.LossControlConsultant,Underwriter,AssignedRiskCustServRep) and the short database codes ("LCR","UW","ARP", etc.), including an explicitUnknownfallback for unrecognized codes.- Once populated, callers may invoke
InitializeEmailAddress(inSQLServerDataPortal)(or the obsolete misspelledInitializeEmaillAddress, or the "using system user" variant) to loop everyclsTeamAssignmentin the collection and callta.InitializeEmailAddress(inSQLServerDataPortal)per member (BR-VP-022). clsTeamAssignment.InitializeEmailAddress(not directly inspected in this pass) is understood from the hub catalog and constructor signatures to resolve the member's email by querying external-client/registrant tables —cp_external_client_lookupon the SQL Server BDS connection (SQL-029) and/orsp73341_external_client_lookupon Oracle (SQL-030).*
Process flow¶
flowchart TD
Start(["Consumer reads<br>TeamAssignmentCollection"]) --> A["GetTeamAssignmentCollection<br>constructs Criteria"]
A --> B["BeforeRetrieve assigns<br>team_assign_query, binds<br>policy num / mask flag"]
B --> C["Framework executes<br>procedure against Oracle"]
C --> D["AfterRetrieve reads rows"]
D --> E{More rows?}
E -->|Yes| F["New clsTeamAssignment,<br>set MaskData, Load, Add"]
F --> E
E -->|No| G["Return populated<br>clsTeamAssignmentCollection"]
G --> H["Caller invokes<br>InitializeEmailAddress"]
H --> I["Per member: resolve email via<br>cp_external_client_lookup (BDS) or<br>sp73341_external_client_lookup (Oracle)"]
Failure and edge-case behavior¶
- Email resolution is a separate, opt-in step (
InitializeEmailAddress) — a caller that only readsTeamAssignmentCollectionwithout calling it will see team members with unresolved email addresses.* InitializeEmaillAddress(the misspelled overload) is marked<Obsolete>but still delegates functionally to the same email-initialization logic asInitializeEmailAddress— both remain callable.CodeToTeamFunctionreturnsTeamFunctions.Unknownfor any database code it does not recognize, rather than raising, which downstream consumers must handle explicitly.
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.
Related documentation¶
Sources¶
SAIF.Business.View.Policy/clsTeamAssignmentCollection.vbSAIF.Business.View.Policy/clsTeamAssignment.vb