Retrieve policy header¶
Every policy view in the consuming applications starts here. The operation loads the single header row that identifies a policy — its names, status, dates, agent and agency numbers, and secure-policy code — and hands back a business object that all other reads in this library hang from. The access level supplied by the caller is stored on the object at this point, because later visibility decisions depend on it.
| Field | Value |
|---|---|
| Operation ID | OP-01 |
| Trigger | A caller requests a policy view |
| Inputs | IDataPortalInfo, policy number, and an optional UserAccessLevels value |
| Outputs | A populated clsPolicyData marked clean |
| Primary components | clsPolicyData.GetPolicyData |
| Entry point | Business/SAIF.Business.View.Policy/clsPolicyData.vb |
Steps¶
- Construct a
Criteriainstance from the data portal information, the policy number, and, when supplied, the caller'sUserAccessLevelsvalue. The access level is retained on the object and later gates which affiliated policies may be displayed (BR-011). - If the caller uses the overload that omits an access level, the criteria keep the library default of
SAIFEmployee, which is the least restrictive value. - The criteria refuse every non-retrieve SQL property, so this object can never be used to write (BR-021).
- Ask the framework data access layer to retrieve the object for those criteria. The framework instantiates
clsPolicyDataand drives the standard retrieve lifecycle around it. - The framework opens the connection, executes the request, and invokes the object's lifecycle hooks in order.†
- On a portal or connection failure the framework raises; this library adds no handling of its own, so the exception surfaces to the caller.
Origin: These sub-steps are implemented by
clsBusinessBaseinSAIF.Framework.Coreand executed on behalf of this operation.†
- In
BeforeRetrieve, build the data request: command type stored procedure, request type reader, statementpk73094_policy_data.getpolicy, then add the policy number parameter and the result cursor (SQL-007). - In
AfterRetrieve, take the returned reader, fill the object's fields from the first row, and mark the object clean. - If the reader returns no row, the object is left unfilled with a policy number of zero, which makes it invalid at the next step (BR-002).
- Register the policy-number validation rule so that
IsValidreflects whether the header actually loaded (BR-009). - A policy number of zero or less leaves a broken rule with the message "Error: Invalid policy number.", and the authorization path refuses access for that object.
- For the multi-policy overload, loop the supplied policy numbers and run this same operation once per number.
- There is no batching: N policy numbers produce N round trips.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Caller requests a policy]) --> C[Build Criteria with policy number<br>and user access level]
C --> R[Framework retrieves the object]
R --> Q[BeforeRetrieve builds the<br>stored procedure request]
Q --> X[(pk73094_policy_data.getpolicy)]
X --> A{Row returned?}
A -->|Yes| F[AfterRetrieve fills fields<br>and marks the object clean]
A -->|No| E[Object stays unfilled<br>with policy number zero]
F --> V[Validation rule evaluates<br>the policy number]
E --> V
V --> Ok([Populated clsPolicyData])
Failure and edge-case behavior¶
- No row for the policy number: the object returns with a policy number of zero and reports itself invalid rather than raising (BR-009).
- Portal or connection failure: the framework exception propagates to the caller unchanged.
- Multi-policy overload with a large list: each number costs a separate round trip, so cost grows linearly.
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/clsPolicyData.vb