Retrieve affiliated policies¶
Where the association list describes how policies are linked, this operation produces the display list an application actually shows: the policies affiliated with a given policy under one affiliation family, optionally with a totals row, and optionally narrowed to the agent or agency making the request.
| Field | Value |
|---|---|
| Operation ID | OP-08 |
| Trigger | A caller requests the affiliated policy collection for a policy |
| Inputs | IDataPortalInfo, policy number, affiliate type, totals flag, and optional agent or agency filters |
| Outputs | A populated clsAffiliatedPolicyCollection with the source policy marked current |
| Primary components | clsAffiliatedPolicyCollection.GetAffiliatedPolicyCollection |
| Entry point | Business/SAIF.Business.View.Policy/clsAffiliatedPolicyCollection.vb |
Steps¶
- In
BeforeRetrieve, set the statement topk72846_view_policy.getpolicyaffiliatelistand add the policy number, the upper-cased affiliate type, the totals flag, and the result cursor (SQL-001). - The affiliate type is truncated to twenty-five characters and its prefix selects which relationship family the procedure walks.
- The totals flag is passed as the literal text
TRUEorFALSE. - In
AfterRetrieve, load each returned row into aclsAffiliatedPolicy. - Apply the agent and agency filter as rows are added (BR-020).
- If both the criteria agent number and agency sequence number are zero, keep every row.
- Otherwise keep a row only when its agent number or agency sequence number matches the criteria.
- Mark the source policy as the current item in the collection so that callers can distinguish it from its affiliates.
- Whether the resulting collection should be shown at all is a separate decision that depends on the caller's access level and the policy's affiliate type (BR-011).
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Affiliated policies requested]) --> Q[BeforeRetrieve adds policy number,<br>affiliate type and totals flag]
Q --> X[(pk72846_view_policy.getpolicyaffiliatelist)]
X --> L[Load each row into<br>clsAffiliatedPolicy]
L --> F{Agent or agency<br>filter supplied?}
F -->|No| Keep[Keep every row]
F -->|Yes| Match{Row matches the<br>agent or agency?}
Match -->|Yes| Keep
Match -->|No| Skip[Skip the row]
Keep --> Cur[Mark the source policy current]
Skip --> Cur
Cur --> Ok([Affiliated policy collection])
Failure and edge-case behavior¶
- An affiliate type with no matching prefix yields an empty collection rather than an error.*
- Filtering happens after retrieval, so rows the caller may not see are still transferred from the database.
Note: Statements marked with
†are derived from dependency library documentation via the Legends CLI. Statements marked with*were inferred from code structure or contextual evidence. Statements marked with**could not be confirmed; treat as unknown until verified.
Related documentation¶
- Operations and processes
- Business rules
- SQL catalog
- Database tables
- Procedures
- Security and authorization
- API reference
Sources¶
Business/SAIF.Business.View.Policy/clsAffiliatedPolicyCollection.vbBusiness/SAIF.Business.View.Policy/clsAffiliatedPolicy.vb