Retrieve policy periods and select the current/renewal period¶
Loads all policy periods (terms) for a policy into a clsPolicyPeriodCollection, and provides selection helpers for the current period, the latest period with a printed information page, and the period effective on an arbitrary date.
| Field | Value |
|---|---|
| Operation ID | op-03-retrieve-policy-periods |
| Trigger | Consumer reads PolicyPeriods (backed by clsPolicyPeriodCollection.GetPolicyPeriodCollection) |
| Inputs | Policy number, optional top-N period limit |
| Outputs | clsPolicyPeriodCollection; GetCurrentPolicyPeriod/GetLatestPolicyPeriodInfoPagePrinted/GetDOIPolicyPeriod return a single clsPolicyPeriod |
| Primary components | clsPolicyPeriodCollection.GetPolicyPeriodCollection, clsPolicyData.GetCurrentPolicyPeriod, GetLatestPolicyPeriodInfoPagePrinted, GetDOIPolicyPeriod |
| Entry point | SAIF.Business.View.Policy/clsPolicyPeriodCollection.vb, SAIF.Business.View.Policy/clsPolicyData.vb |
Steps¶
- Caller invokes
clsPolicyPeriodCollection.GetPolicyPeriodCollection(inDataportal, inPolicyNum[, inTopNPolicyPeriods]), which constructs aCriteriaand delegates toinDataportal.DataAccessLayer.RetrieveObject. - Framework invokes
BeforeRetrieve: creates a newIDataRequest, assignsMyCriteria.RetrieveSQL(constant"pk72846_view_policy.getPolicyPeriods", SQL-022), setsCommandType = StoredProcedure, and bindsapolicynumandaTopNPolPer(fromMyCriteria.TopNPolicyPeriods, defaulting to0when the two-argument overload is used) plus a cursor parameterrecordset. - Framework executes the procedure against Oracle.
- Framework invokes
AfterRetrieve: casts the result toIDataReader, loopsReader.Read, and for each row constructs aNew clsPolicyPeriod, callsPolicyPeriod.Load(CriteriaObject.DataPortalInfo, Reader), and adds it viaMyBase.Add. - Once populated,
clsPolicyData.GetCurrentPolicyPeriod()iteratesPolicyPeriodsand returns the first period whereisCurrentPolicyPeriodis true; if none match, it falls back toPolicyPeriods(0)(the first period in retrieval order), orNothingif the collection is empty (BR-VP-018). GetLatestPolicyPeriodInfoPagePrinted()iteratesPolicyPeriodsand returns the first period that is bothisRenewalPolicyPeriodand has its information page printed (viaIsInformationPagePrinted, see Lazy retrieval of policy detail and indicators); if a period isisCurrentPolicyPeriodit is returned instead without the printed check; otherwise falls back toPolicyPeriods(0)orNothing(BR-VP-019).GetDOIPolicyPeriod(inDOI),GetDOISalesPlan(inDOI), andGetDOIFinalEvalDate(inDOI)all delegate toPolicyPeriods.ItemEffectiveAtDOI(inDOI), a collection indexer that returns the first period whereinDOIfalls within[PolicyPeriodEffDate, PolicyPeriodExpDate); the sales-plan and final-eval-date helpers return sentinel values ("Not Found",Date.MinValue) when no period matches rather than raising an exception.
Process flow¶
flowchart TD
Start(["Consumer reads<br>PolicyPeriods"]) --> A["GetPolicyPeriodCollection<br>constructs Criteria"]
A --> B["BeforeRetrieve assigns<br>getPolicyPeriods, binds<br>apolicynum/aTopNPolPer"]
B --> C["Framework executes<br>procedure against Oracle"]
C --> D["AfterRetrieve reads rows"]
D --> E{More rows?}
E -->|Yes| F["New clsPolicyPeriod / Load /<br>Add to collection"]
F --> E
E -->|No| G["Return populated<br>clsPolicyPeriodCollection"]
G --> H["GetCurrentPolicyPeriod /<br>GetLatestPolicyPeriodInfoPagePrinted /<br>GetDOIPolicyPeriod select a period"]
Failure and edge-case behavior¶
- An empty result set yields an empty collection;
GetCurrentPolicyPeriodandGetLatestPolicyPeriodInfoPagePrintedboth returnNothingin that case rather than throwing. GetLatestPolicyPeriodInfoPagePrintedcallsIsInformationPagePrintedfor every renewal period it encounters until a match or anisCurrentPolicyPeriodshort-circuit — this is a data-access call per iteration, not a cached lookup.*GetDOISalesPlan/GetDOIFinalEvalDatereturn string/date sentinels ("Not Found",Date.MinValue) instead ofNothing/raising when no period is effective on the given date — callers must check for these sentinel values 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/clsPolicyPeriodCollection.vbSAIF.Business.View.Policy/clsPolicyData.vb